[ 
https://issues.apache.org/jira/browse/MJAVADOC-648?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Phil updated MJAVADOC-648:
--------------------------
    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
{code:java}
<modules>
  <module>../module-1</module>
</modules>
{code}
this becomes the module Path
{code:java}
 Path p = new File(aggregatedProject.getBasedir(), module).toPath();{code}
{code:java}
/home/java/project/parent/../module-1
{code}
which is not Java equal() to the reactor path for that module of:
{code:java}
/home/java/project/module-1
{code}
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.
{code:java}
Path p = new File(aggregatedProject.getBasedir(), module ).toPath();
modulePaths.add(p.normalize());
{code}
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.

  was:
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
{code:java}
<modules>
  <module>../module-1</module>
</modules>
{code}
this becomes the module Path
{code:java}
 Path p = new File(aggregatedProject.getBasedir(), module).toPath();{code}
{code:java}
/home/java/project/parent/../module-1
{code}
which is not Java equal() to the reactor path for that module of:
{code:java}
/home/java/project/module-1
{code}
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.
{code:java}
Path p = new File(aggregatedProject.getBasedir(), module ).toPath();
modulePaths.add(p.normalize());
{code}

This works for my project, but potentially this is not a proper/robust fix for 
this issue. This all used to worked 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.


> Aggregate apidocs not built for a flat maven multi-module project 
> ------------------------------------------------------------------
>
>                 Key: MJAVADOC-648
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-648
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: javadoc
>    Affects Versions: 3.1.0, 3.1.1, 3.2.0
>            Reporter: Phil
>            Priority: Major
>
> 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
> {code:java}
> <modules>
>   <module>../module-1</module>
> </modules>
> {code}
> this becomes the module Path
> {code:java}
>  Path p = new File(aggregatedProject.getBasedir(), module).toPath();{code}
> {code:java}
> /home/java/project/parent/../module-1
> {code}
> which is not Java equal() to the reactor path for that module of:
> {code:java}
> /home/java/project/module-1
> {code}
> 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.
> {code:java}
> Path p = new File(aggregatedProject.getBasedir(), module ).toPath();
> modulePaths.add(p.normalize());
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to