~ubuntu-branches/ubuntu/precise/surefire/precise

« back to all changes in this revision

Viewing changes to maven-surefire-report-plugin/src/site/apt/examples/cross-referencing.apt.vm

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2011-10-10 20:42:16 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20111010204216-cemva69wkagf4fay
Tags: 2.10-1
* Team upload.
* New upstream release.
* Refresh and remove unneccesary patches.
* Add Build-Depends on libsurefire-java and
  libmaven-common-artifact-filters-java.
* Drop outdated Maven artifact surefire-junit.
* Provide new Maven artifacts: surefire-junit3, maven-surefire-common,
  common-junit3, common-junit4, surefire-junit47 and surefire-testng-utils.
* Fix clean target to allow "two in a row" builds.
* Update Vcs-Browser field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
  ------
 
2
  Source Code Cross Reference
 
3
  ------
 
4
  Allan Ramirez
 
5
  ------
 
6
  July 2006
 
7
  ------
 
8
 
 
9
~~ Copyright 2006 The Apache Software Foundation.
 
10
~~
 
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
 
14
~~
 
15
~~      http://www.apache.org/licenses/LICENSE-2.0
 
16
~~
 
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.
 
22
 
 
23
~~ NOTE: For help with the syntax of this file, see:
 
24
~~ http://maven.apache.org/doxia/references/apt-format.html
 
25
 
 
26
Source Code Cross Reference
 
27
 
 
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
 
34
  documentation of the
 
35
  {{{http://maven.apache.org/plugins/maven-jxr-plugin/}Maven JXR Plugin}}.
 
36
 
 
37
+----+
 
38
<project>
 
39
  [...]
 
40
  <reporting>
 
41
    <plugins>
 
42
      <plugin>
 
43
        <groupId>org.apache.maven.plugins</groupId>
 
44
        <artifactId>maven-surefire-report-plugin</artifactId>
 
45
        <version>${project.version}</version>
 
46
        <configuration>
 
47
          <!-- place your configuration here -->
 
48
        </configuration>
 
49
      </plugin>
 
50
      <plugin>
 
51
        <groupId>org.apache.maven.plugins</groupId>
 
52
        <artifactId>maven-jxr-plugin</artifactId>
 
53
        <version>2.1</version>
 
54
      </plugin>
 
55
    </plugins>
 
56
  </reporting>
 
57
  [...]
 
58
</project>
 
59
+----+
 
60
 
 
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.
 
64
 
 
65
  From the figure below the code that caused the failure is
 
66
  <com.test.proj.AppTest:36>
 
67
 
 
68
[../images/failure-details.PNG] Failure Details
 
69
 
 
70
  The link will redirect you to the source by clicking it.
 
71
 
 
72
[../images/xref.PNG] The source
 
73
 
 
74
* Disable the Cross Reference Link
 
75
 
 
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.
 
79
 
 
80
  
 
81
 
 
82
 
 
83
 
 
84