I have multi-module Maven project in which I run the maven-javadoc-plugin to generate javadoc. In my parent pom.xml I have defined the plugin build as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<!-- Default configuration for all reports -->
</configuration>
<executions>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate-jar</goal>
</goals>
<phase>install</phase>
<configuration>
<!-- Specific configuration for the aggregate report -->
</configuration>
</execution>
</executions>
</plugin>
When I run mvn clean install
the build fails with unresolved dependencies, but I see the following warning:
[WARNING] The dependency: [my.application:my-module:jar:1.7.1] can't be resolved but has been found in the reactor (probably snapshots). This dependency has been excluded from the Javadoc classpath. You should rerun javadoc after executing mvn install.
As I am currently building my-module 1.7.1, I would assume Maven to detect this and run the aggregate-jar after building my-module, but for some reason it expects my-module to already be installed in a repo.
My Maven version is 3.0.4. Please keep in mind that I am new to Maven builds so this may be a very simple question, but I was not able to find any answer.
Some observations:
- The build succeeds if I first run
mvn clean install
without the javadoc pluginaggregate-jar
goal - The javadoc plugin
aggregate
goal runs fine. - This bug refers exactly to my issue, but should have been solved in Maven 3 (2010)
mvn package javadoc:aggregate-jar
instead." - you could give that a try. – Kuykendall