Source Code Cross Reference
The Surefire Report Plugin can link every reported test to its source class. For failed tests, the failure details link directly to the source line when it is available from the stack trace. To activate this feature, declare the maven-jxr-plugin in the <reporting> section of the POM along with the maven-surefire-report-plugin. For more details, read the documentation of the Maven JXR Plugin.
<project>
[...]
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<!-- place your configuration here -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</reporting>
[...]
</project>
After executing mvn site, each test name links to its source class. The Failure Details section additionally links to the source line that caused the failure when that line can be determined.
In the figure below the code that caused the failure is com.test.proj.AppTest:36

The link will redirect you to the source by clicking it.

Disabling the Cross Reference Link
To disable the link to the source code, the linkXRef property should be set to false. Alternatively one may simply omit the maven-jxr-plugin from the <reporting> section.

