I have in pom the plugin maven-surefire-plugin with skipTests on true. However, sometimes I want to run the tests from the command line and I want to overwrite this plugin from command line and to leave the pom file unchanged.
I tried
mvn install -DskipTests=false but it still skips the tests...
Any idea how I can solve my problem...?
Thanks
Skipping by default is specifically discussed in the plugin documentation:
If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a properties section in the pom
In other words use a property for the default:
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
Define a property:
<properties>
<skipTests>true</skipTests>
</properties>
Properties can be overridden from the command-line:
mvn install -DskipTests=false
Note that the skipTests in the command-line above refers to the property, not to the plugin parameter with the same name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With