Maven Surefire Plugin
Jump to navigation
Jump to search
External
- http://maven.apache.org/surefire/maven-surefire-plugin/
- http://maven.apache.org/surefire/maven-surefire-report-plugin/
Internal
Configuration Example
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>basedir</name> <value>${basedir}</value> </property> </systemProperties> </configuration> </plugin>
Attaching the Plugin to a Specific Phase
<executions>
<execution> <id>attach-sources</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions>
Procedures
Debugging Tests
- Debugging Example: http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html]
mvn -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" test
Running Individual Tests
- Single Test Example: http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html
mvn -Dtest=TestCircle test
Works for both JUnit and TestNG.