An easy way would be to run two separate commands. In Bash, it's easy to concatenate them on one line:
mvn clean cobertura:cobertura && mvn package -Dmaven.test.skip=true
First bit:
mvn clean cobertura:cobertura
Cleans, runs tests, and generates a coverage report.
Second bit:
mvn package -Dmaven.test.skip=true
Makes packaging, but says that it does not run tests.
&& exists so that if the first command fails, then it will not try to start the second.
source share