I have project that I set to build with the test-jar
and normal jar by using this setting:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
The problem with this is whenever I upgrade the project version in the pom, I need to do a build with the tests, otherwise maven won't be able to find the test-jar with the correct version during the test-compile
phrase. A lot of time I would just want to skip the tests, but due to the test-jar missing, the test-compile
phrase will fail.
I tried to use -Dmaven.test.skip=true
, but that doesn't seem to skip the test-compile
phase. Is there a way to skip this?
$ mvn clean install -Dmaven.test.skip=true \
-Dmaven.site.skip=true -Dmaven.javadoc.skip=true