Error generating maven documentation
When I run mvn site
I get the error:
java.lang.NullPointerException
at org.codehaus.mojo.versions.ordering.MavenVersionComparator.innerGetSegmentCount(MavenVersionComparator.java:5
1)
at org.codehaus.mojo.versions.ordering.AbstractVersionComparator.getSegmentCount(AbstractVersionComparator.java:
27)
This appears to be a Maven bug, which according to the JIRA ticket has been resolved in version 1.2. I'm assuming this means version 1.2 of a particular plugin (probably the site plugin).
Does anyone know whether this fix has been released, and if so, how can I force Maven to use the version of the plugin that includes this fix?
Update
As suggested below, I added
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
to my pom.xml. But I now get the following error instead:
java.lang.NullPointerException
at org.codehaus.mojo.versions.PluginUpdatesDetails.isDependencyUpdateAvailable(PluginUpdatesDetails.ja开发者_如何学运维va:68)
at org.codehaus.mojo.versions.PluginUpdatesRenderer.renderSummaryTotalsTable(PluginUpdatesRenderer.java:132)
at org.codehaus.mojo.versions.PluginUpdatesRenderer.renderBody(PluginUpdatesRenderer.java:71)
Thanks, Don
It's the Codehaus Versions Maven Plugin.
Here's the config with the version you need:
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.2</version>
<reportSets>
...
</reportSets>
</plugin>
</plugins>
</reporting>
Edit:
For the new error, this source code line (68) suggests that a dependency is referenced without a version. Try looking for a plugin without a <version>
.
63 public boolean isDependencyUpdateAvailable()
64 {
65 for ( Iterator i = dependencyVersions.values().iterator(); i.hasNext(); )
66 {
67 ArtifactVersions versions = (ArtifactVersions) i.next();
68 if ( versions.getAllUpdates( UpdateScope.ANY, includeSnapshots ).length > 0 )
69 {
70 return true;
71 }
72 }
73 return false;
74 }
精彩评论