user3723176
user3723176

Reputation: 33

A: Can't generate reports for Maven site (Maven 3.0.x)

I just want to include basic reports in my Maven site. I've included this in my POM:

<project>
 ...
<reporting>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.7</version>
    </plugin>
  </plugins>
</reporting>  
...
</project>

And this included in my site descriptor, index.xml:

<project>
...
  <body>
    <menu ref="reports" />
  </body>
</project>

When I use mvn site:run none of the reports are generated, and the menu isn't generated in the navigation. The only way I can generate reports is with direct command line calls, like mvn project-info-reports. I can't get them on the site. All the help for Maven sites seems to be from 2010 so it's hard to figure out what's accurate. Here's what happens when I use clean site:run -Dport=8081:

[INFO] ------------------------------------------------------------------------
[INFO] Building travelagentservice-client 1.0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]  
[INFO] --- maven-site-plugin:2.2:run (default-cli) @ travelagentservice-client ---
2014-06-10 15:41:30.812::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Parent project loaded from repository: choicehotels:corporate-pom:pom:2.1.0.0
[INFO] Starting Jetty on http://localhost:8081/
2014-06-10 15:41:30.960::INFO:  jetty-6.1.5
2014-06-10 15:41:30.158::INFO:  NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
2014-06-10 15:41:30.264::INFO:  Started [email protected]:8081

Solution I figured out: I needed to specify the version of site I was using. It has to be 3.3.

<plugin>
    <artifactId>maven-site-plugin</artifactId>
    <version>3.3</version>
</plugin>

Upvotes: 3

Views: 189

Answers (1)

hboutemy
hboutemy

Reputation: 321

  1. like any plugin, you should specify a version in your pom
  2. yes, maven-site-plugin 3.x is absolutely required for use with Maven 3: see http://maven.apache.org/plugins/maven-site-plugin/maven-3.html
  3. if you run mvn site with no plugin version, you should get a warning

Upvotes: 2

Related Questions