2
Source Code Cross Reference
9
~~ Copyright 2006 The Apache Software Foundation.
11
~~ Licensed under the Apache License, Version 2.0 (the "License");
12
~~ you may not use this file except in compliance with the License.
13
~~ You may obtain a copy of the License at
15
~~ http://www.apache.org/licenses/LICENSE-2.0
17
~~ Unless required by applicable law or agreed to in writing, software
18
~~ distributed under the License is distributed on an "AS IS" BASIS,
19
~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
~~ See the License for the specific language governing permissions and
21
~~ limitations under the License.
23
~~ NOTE: For help with the syntax of this file, see:
24
~~ http://maven.apache.org/doxia/references/apt-format.html
26
Source Code Cross Reference
28
There are times when we need to know right away the line number of the
29
source code that caused the failure of the test. The Surefire Report Plugin
30
has the capability to cross reference the source code that made the test
31
failed. To be able to activate it, the <<<maven-jxr-plugin>>> should
32
also be declared in the \<reporting\> section of the POM along with the
33
<<<maven-surefire-report-plugin>>>. For more details, please read the
35
{{{http://maven.apache.org/plugins/maven-jxr-plugin/}Maven JXR Plugin}}.
43
<groupId>org.apache.maven.plugins</groupId>
44
<artifactId>maven-surefire-report-plugin</artifactId>
45
<version>${project.version}</version>
47
<!-- place your configuration here -->
51
<groupId>org.apache.maven.plugins</groupId>
52
<artifactId>maven-jxr-plugin</artifactId>
53
<version>2.1</version>
61
After executing <<<mvn site>>> for site generation, You'll notice that from
62
the <<Failure Details>> section of the report, the link is available to
63
redirect you to the source code that caused the failure.
65
From the figure below the code that caused the failure is
66
<com.test.proj.AppTest:36>
68
[../images/failure-details.PNG] Failure Details
70
The link will redirect you to the source by clicking it.
72
[../images/xref.PNG] The source
74
* Disable the Cross Reference Link
76
To disable the link to the source code, the <<linkXRef>> property should
77
be set to <<false>>. Or another way is by not declaring the
78
<<<maven-jxr-plugin>>> to the \<reporting\> section.