Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven package/install without test (skip tests)

Tags:

java

maven

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?

like image 322
vks Avatar asked Sep 17 '11 15:09

vks


People also ask

What is Maven test Skip?

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.

How can I skip test cases in Eclipse?

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.

How do you skip a test in Java?

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.


1 Answers

Run maven with

mvn package -Dmaven.test.skip 
like image 53
Giorgos Dimtsas Avatar answered Oct 11 '22 23:10

Giorgos Dimtsas