Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-648

Aggregate apidocs not built for a flat maven multi-module project

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.1.0, 3.1.1, 3.2.0
    • None
    • javadoc
    • None

    Description

      When using a flat multi-module maven project e.g.

      parent
      +-- pom.xml (parent and reactor)
      module-1
      +-- pom.xml
      module-...
      +-- pom.xml

      The aggregate apidocs e.g. mvn javadoc:aggregate, are not built for the parent project. This is because the AbstractJavadocMojo#getAggregatedProjects() does not return any sub projects for the parent.

      More specifically, #modulesForAggregatedProject(..) compares the module path from the POM with the module path from the reactor, and these can be different if the Paths are not normalised e.g.

      in the parent pom.xml

      <modules>
        <module>../module-1</module>
      </modules>
      

      this becomes the module Path

       Path p = new File(aggregatedProject.getBasedir(), module).toPath();
      /home/java/project/parent/../module-1
      

      which is not Java equal() to the reactor path for that module of:

      /home/java/project/module-1
      

      Even though they should be same. Hence the set of modules for the aggregated project is empty.

      I downloaded the source and rebuilt the plugin normalising the module Path e.g.

      Path p = new File(aggregatedProject.getBasedir(), module ).toPath();
      modulePaths.add(p.normalize());
      

      This works for my project, but potentially this is not a proper/robust fix for this issue. This all used to work fine in 3.0.1 of the plugin - although I see a decent change in the codebase around this from 3.0.1 to 3.1.0.

      Is this a bug? or is it actually meant to work like this? which would be an issue for the project I am working on going forward.

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            philsmart Phil
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: