Section 4.1. Reporting on Project Content


4.1. Reporting on Project Content

It is useful to provide visibility on project content, such as mailing lists used, the development team, the Source Control Management (SCM) repository used, the project dependencies, and more.

4.1.1. How do I do that?

The XDoc plug-in automatically generates project information by parsing the Project Object Model (POM). Let's take the qotd/core subproject. Typing maven xdoc (also called if you run maven site) generates Figure 4-1, where you can see the following four reports:


Mailing Lists

The different mailing lists used by the project. They are defined in the POM using the mailingLists tag (see "Telling Maven About Your Team" in Section 1.1).


Project Team

The members of the teams, and their roles. They are defined in the POM using the developers and contributors tags (see "Telling Maven About Your Team" in Section 1.1).


Dependencies

A list of external dependencies used by the project. They are defined in the POM using the dependencies tag (see "Adding a Dependency" in Section 1.1).


Issue Tracking

A link to the issue tracker used by the project. It is defined in the POM using the issueTrackingUrl tag.

Figure 4-1. The four project information reports generated by the XDoc plug-in


Figure 4-2 shows the Dependencies report for qotd/core. It provides interesting information for people who want to use your project, as they can see at a glance what dependencies they'll be using.

Figure 4-2. Dependencies report for the qotd/core project


Note that the URL field is computed from the optional url tag that you can define in a dependency tag:

    <dependency>       <groupId>rome</groupId>       <artifactId>rome</artifactId>       <version>0.5</version>       <url>http://rome.dev.java.net/</url>     </dependency>

It is also useful to ask Maven to generate HTML pages for the source code (main sources and test sources). You'll see in the rest of this chapter that several other reports are automatically linked to these HTML pages. You generate these reports by adding the JXR plug-in's report to the reports section of your project's POM. Add it to qotd/core/project.xml:

<reports>   <report>maven-jxr-plugin</report> </reports>

4.1.2. What about...

...other project information reports?

You could use the License and Linkcheck plug-ins. The former displays your license (specified using the maven.license.licenseFile property, which defaults to ${basedir}/LICENSE.txt) and the latter generates a report listing all the broken links in the web site generated by the execution of maven site. You add them to your POM by adding the maven-license-plugin and maven-linkcheck-plugin report elements in the reports section of your POM.



Maven. A Developer's Notebook
Maven: A Developers Notebook (Developers Notebooks)
ISBN: 0596007507
EAN: 2147483647
Year: 2003
Pages: 125

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net