You can skip the test in two following ways :-
By configuring the Pom.xml , if you are using surefire plugin then you can configure as below.
For specific module test you can create profile in pom.xml for specific environment and it will help to skip the test cases.You can skip this specified profile "noTest".
By using Command Line :-
1) -Dmaven.test.skip=true
2) -DskipTests ( The values can be true/false)
Example -
1 ) mvn clean install -DskipTests=true
2 ) mvn clean install -Dmaven.test.skip=true
Find More Solutions -
By configuring the Pom.xml , if you are using surefire plugin then you can configure as below.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
For specific module test you can create profile in pom.xml for specific environment and it will help to skip the test cases.You can skip this specified profile "noTest".
<profiles>
<profile>
<id>noTest</id>
<activation>
<property>
<name>noTest</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
By using Command Line :-
1) -Dmaven.test.skip=true
2) -DskipTests ( The values can be true/false)
Example -
1 ) mvn clean install -DskipTests=true
2 ) mvn clean install -Dmaven.test.skip=true
Hope it will help you.
Find More Solutions -
- How to create Jenkins Job ?
- How to skip test case in maven build ?
- How to skip integration test cases in maven ?
- Jenkins - Unknown lifecycle phase "mvn"
No comments:
Post a Comment