How to skip tests when using the Maven reactor?

I am working on a Maven project with several modules. I want to create this module and skip unit tests to speed up the build process.

I tried the following:

mvn reactor:make -Dmake.folders=search -Dgoals=package,-DskipTests

mvn reactor:make -Dmake.folders=search -Dgoals=package -Dmaven.test.skip=True

However, this has no effect. Any clues?

+3
source share
3 answers

Your first line looks like the right idea, but -Dgoalsyou should use instead -Dmake.goals.

On the page are examples of plugins for the reactor :

Maven, . Maven , Maven, --debug, -DskipTests.

Maven, -Dmake.goals, :

mvn reactor:resume -Dmake.folders=barBusinessLogic -Dmake.goals=install,-DskipTests

, "" - Maven; "".

- , -Dmake.printOnly, . , , !

+6

/
  A/pom.xml
  B/pom.xml
  C/pom.xml
  D/pom.xml
  E/pom.xml
  pom.xml (parent pom file that includes A,B,C,D,E modules)

mvn reactor:make -Dmake.folders=C,D,E -Dgoals=package -Dmaven.test.skip=True

, , , ,

mvn -pl=C,D,E -DskipTests=true package
+3

Have you tried to include the parameter - Dmaven.test.skip = true (note the case) on the command line argument that you are using? Like Java, Maven is case sensitive. But, as a rule, you can refuse the true part, and this should also lead to skipping tests.

+2
source

Source: https://habr.com/ru/post/1776181/


All Articles