Maven Surefire Plugin: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 28: Line 28:
=Attaching the Plugin to a Specific Phase=
=Attaching the Plugin to a Specific Phase=


<executions>
{{Internal|Maven_Concepts#Plugin_Execution|Plugin Execution}}
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>


=Procedures=
=Procedures=

Revision as of 16:30, 11 January 2017

External

Internal

Configuration Example

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19.1</version>
    <configuration>
        <systemProperties>
            <property>
                <name>basedir</name>
                <value>${basedir}</value>
            </property>
        </systemProperties>
   </configuration>
</plugin>

Attaching the Plugin to a Specific Phase

Plugin Execution

Procedures

Debugging Tests

mvn -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" test

Running Individual Tests

mvn -Dtest=TestCircle test

Works for both JUnit and TestNG.