Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Duplicate
-
Affects Version/s: 2.5, 2.6, 2.6.1, 2.7
-
Fix Version/s: 2.8
-
Labels:None
-
Environment:mac OSX 10.6.4
-
Number of attachments :
Description
Repro Case:
- I have a war based maven configuration with the maven-javadoc-plugin as copied below.
- > mvn jetty:run
Result:
- When jetty loads, every servlet fails to load, the first is always java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener followed by null pointers and CNFE's on every servlet.
When i take out the execution of the maven-javadoc-plugin everything works?! My only guess is that when the javadoc plugin runs, it does something with the classpath such that when jetty runs it doesn't have what it needs to find all the classes correctly.
My javadoc configuration is as follows:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <goals> <goal>javadoc</goal> </goals> <phase>generate-resources</phase> </execution> </executions> </plugin>
Issue Links
- duplicates
-
MJAVADOC-279
Javadoc plugin doesn't set dependencies correctly when pom uses classifiers
-
- is related to
-
MPIR-223
Dependency report introduces corruption in classpaths for other plugins
-
a workaround, which might help indicate the source of the problem, is to use the "aggregate" goal instead of the "javadoc" goal.
it appears that the two goals do essentially the same thing, except that the aggregate goal is run as an aggregator plugin:
http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html
http://maven.apache.org/plugins/maven-javadoc-plugin/aggregate-mojo.html
http://docs.codehaus.org/display/MAVEN/Aggregator+Plugins
which has the benefit that the execution is always forked, so the classpath munging doesn't affect the rest of your lifecycle. Looking at the source, you can see that the "aggregate" goal simply extends the "javadoc" goal and turns on the "aggregator" bit:
http://maven.apache.org/plugins/maven-javadoc-plugin/xref/org/apache/maven/plugin/javadoc/AggregatorJavadocReport.html
Looking at the wiki on Aggregator Plugins, I don't see any reason why it should be dangerous to use that on a non-aggregate project, and empirically, this seems to work around the issues Bryan mentions above.