Maven Javadoc aggregate-jar plugin fails because of unresolved dependencies
Asked Answered
K

1

6

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 plugin aggregate-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)
Kristalkristan answered 10/12, 2013 at 14:23 Comment(5)
The last comment in the maven bug you reference MNG-4618 is from someone who states that the bug has not been fixed (or has reappeared) - you might want to specifically reopen that bug and state that you are also having the problem. The user states the following "I can ONLY successfully aggregate JavaDocs by removing the <executions> and calling mvn package javadoc:aggregate-jar instead." - you could give that a try.Kuykendall
I assumed that using javadoc aggregate-jar goal in a multimodule project would be very commonly used operation, so I was unsure whether I am doing stuff the right way. I try to follow your suggestions of reopening the bug, but I do not have the permissions to alter the maven command as it is used in a shared build job. EDIT: To reopen or comment on the bug I need access to Codehaus Jira, and that I have to request from an administrator. Is there an easier way to submit my info to that case/bug?Kristalkristan
I managed to create a Jira account on Codehaus and have now added my comment to the bug.Kristalkristan
Did you find a solution about this problem?Lapful
This problem might also be caused by MJAVADOC-437 which was fixed in late 2015 and has been scheduled to be released as part of maven-javadoc-plugin 2.10.4 which unfortunately has not been released yet as of today (June 2016).Tortuous
H
0

I run this command in my parent pom and this is how I do it without issues:

<build>
    <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.1</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

When I want to generate the docs, I do mvn javadoc:aggregate

Herrenvolk answered 10/3, 2015 at 21:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.