|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0"> |
| 2 | + <modelVersion>4.0.0</modelVersion> |
| 3 | + <groupId>com.example</groupId> |
| 4 | + <artifactId>junit5-sample</artifactId> |
| 5 | + <version>1.0</version> |
| 6 | + |
| 7 | + <dependencies> |
| 8 | + <dependency> |
| 9 | + <groupId>org.junit.jupiter</groupId> |
| 10 | + <artifactId>junit-jupiter</artifactId> |
| 11 | + <version>5.10.0</version> |
| 12 | + <scope>test</scope> |
| 13 | + </dependency> |
| 14 | + </dependencies> |
| 15 | + |
| 16 | + <build> |
| 17 | + <plugins> |
| 18 | + <plugin> |
| 19 | + <groupId>org.apache.maven.plugins</groupId> |
| 20 | + <artifactId>maven-surefire-plugin</artifactId> |
| 21 | + <version>3.1.2</version> |
| 22 | + <configuration> |
| 23 | + <useModulePath>false</useModulePath> |
| 24 | + <testFailureIgnore>true</testFailureIgnore> <!-- don't stop the build because tests failed --> |
| 25 | + |
| 26 | + <!-- render @displayName in xml output--> |
| 27 | + <statelessTestsetReporter |
| 28 | + implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter"> |
| 29 | + <disable>false</disable> |
| 30 | + <version>3.0</version> |
| 31 | + <usePhrasedFileName>true</usePhrasedFileName> |
| 32 | + <usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName> |
| 33 | + <usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName> |
| 34 | + <usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName> |
| 35 | + </statelessTestsetReporter> |
| 36 | + </configuration> |
| 37 | + </plugin> |
| 38 | + |
| 39 | + <!-- copy test results to root directory, runs when 'verify' is included in mvn target--> |
| 40 | + <plugin> |
| 41 | + <groupId>org.apache.maven.plugins</groupId> |
| 42 | + <artifactId>maven-antrun-plugin</artifactId> |
| 43 | + <version>3.1.0</version> |
| 44 | + <executions> |
| 45 | + <execution> |
| 46 | + <id>copy-test-result</id> |
| 47 | + <phase>verify</phase> |
| 48 | + <configuration> |
| 49 | + <target> |
| 50 | + <copy file="target/surefire-reports/TEST-com.example.SampleTests.xml" |
| 51 | + tofile="TestResults.xml" /> |
| 52 | + </target> |
| 53 | + </configuration> |
| 54 | + <goals> |
| 55 | + <goal>run</goal> |
| 56 | + </goals> |
| 57 | + </execution> |
| 58 | + </executions> |
| 59 | + </plugin> |
| 60 | + </plugins> |
| 61 | + |
| 62 | + </build> |
| 63 | +</project> |
0 commit comments