I am trying to package my project. But, it automatically runs the tests previous do performing the packaging. The tests insert some content in the database. This is not what I want, I need to avoid running tests while package the application. Anybody knows how run the package with out test?
In Maven, you can define a system property -Dmaven. test. skip=true to skip the entire unit test. By default, when building project, Maven will run the entire unit tests automatically. If any unit tests is failed, it will force Maven to abort the building process.
You can put the property maven. test. skip in a profile in your pom. And then you activate this profile in eclipse in the project properties of maven in eclipse.
If you want to ignore a test method, use @Ignore along with @Test annotation. If you want to ignore all the tests of class, use @Ignore annotation at the class level.
Run maven with
mvn package -Dmaven.test.skip
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