[MJAVADOC-134] Support aggregated reports at each level in the multi-module hierarchy
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/pom.xml
new file mode 100644
index 0000000..423ac76
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134c</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc134d1</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java
new file mode 100644
index 0000000..3688552
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java
@@ -0,0 +1,25 @@
+package a.b.c.d;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class D1
+{
+
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/pom.xml
new file mode 100644
index 0000000..f1e343e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134c</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc13d2</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java
new file mode 100644
index 0000000..d588de3
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java
@@ -0,0 +1,25 @@
+package a.b.c.d;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class D2
+{
+
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml
new file mode 100644
index 0000000..651c68d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134b</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc134c</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>d1</module>
+ <module>d2</module>
+ </modules>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/e/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/pom.xml
new file mode 100644
index 0000000..6190c2e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134b</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc134e</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java
new file mode 100644
index 0000000..9b8dcb7
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java
@@ -0,0 +1,25 @@
+package a.b.e;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public interface E
+{
+
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml
new file mode 100644
index 0000000..736b908
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc134b</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>c</module>
+ <module>e</module>
+ </modules>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/f/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/f/pom.xml
new file mode 100644
index 0000000..df1e239
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/f/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc13df</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java b/src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java
new file mode 100644
index 0000000..1f72633
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java
@@ -0,0 +1,24 @@
+package a.f;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public interface F
+{
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties b/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties
new file mode 100644
index 0000000..a3d335e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals = site
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml
new file mode 100644
index 0000000..c11907e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+ <artifactId>mjavadoc134</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <url>https://issues.apache.org/jira/browse/MJAVADOC-134</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <modules>
+ <module>b</module>
+ <module>f</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@sitePluginVersion@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>aggregate</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.9</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy b/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy
new file mode 100644
index 0000000..c2709c3
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// A
+assert new File( basedir, 'target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/b/c/d/D2.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/b/e/E.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/f/F.html').exists()
+
+// B
+assert new File( basedir, 'b/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'b/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert new File( basedir, 'b/target/site/apidocs/a/b/e/E.html').exists()
+assert !(new File( basedir, 'b/target/site/apidocs/a/f/F.html').exists())
+
+// C
+assert new File( basedir, 'b/c/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'b/c/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert !(new File( basedir, 'b/c/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/target/site/apidocs/a/f/F.html').exists())
+
+// D1
+assert new File( basedir, 'b/c/d1/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/f/F.html').exists())
+
+// D2
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert new File( basedir, 'b/c/d2/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/f/F.html').exists())
+
+// E
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert new File( basedir, 'b/e/target/site/apidocs/a/b/e/E.html').exists()
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/f/F.html').exists())
+
+// F
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/e/E.html').exists())
+assert new File( basedir, 'f/target/site/apidocs/a/f/F.html').exists()
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index b1e9f56..88b83bc 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -118,6 +118,7 @@
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
@@ -1970,11 +1971,6 @@
return;
}
- if ( isAggregator() && !project.isExecutionRoot() )
- {
- return;
- }
-
if ( getLog().isDebugEnabled() )
{
this.debug = true;
@@ -2277,9 +2273,9 @@
mappedSourcePaths.putAll( getDependencySourcePaths() );
}
- if ( isAggregator() && project.isExecutionRoot() )
+ if ( isAggregator() )
{
- for ( MavenProject subProject : reactorProjects )
+ for ( MavenProject subProject : getAggregatedProjects() )
{
if ( subProject != project )
{
@@ -2335,6 +2331,57 @@
return mappedSourcePaths;
}
+ private Collection<MavenProject> getAggregatedProjects()
+ {
+ Map<Path, MavenProject> reactorProjectsMap = new HashMap<>();
+ for ( MavenProject reactorProject : this.reactorProjects )
+ {
+ reactorProjectsMap.put( reactorProject.getBasedir().toPath(), reactorProject );
+ }
+
+ return modulesForAggregatedProject( project, reactorProjectsMap );
+ }
+
+ /**
+ * Recursively add the modules of the aggregatedProject to the set of aggregatedModules.
+ *
+ * @param aggregatedProject the project being aggregated
+ * @param reactorProjectsMap map of (still) available reactor projects
+ * @throws MavenReportException if any
+ */
+ private Set<MavenProject> modulesForAggregatedProject( MavenProject aggregatedProject,
+ Map<Path, MavenProject> reactorProjectsMap )
+ {
+ // Maven does not supply an easy way to get the projects representing
+ // the modules of a project. So we will get the paths to the base
+ // directories of the modules from the project and compare with the
+ // base directories of the projects in the reactor.
+
+ if ( aggregatedProject.getModules().isEmpty() )
+ {
+ return Collections.singleton( aggregatedProject );
+ }
+
+ List<Path> modulePaths = new LinkedList<Path>();
+ for ( String module : aggregatedProject.getModules() )
+ {
+ modulePaths.add( new File( aggregatedProject.getBasedir(), module ).toPath() );
+ }
+
+ Set<MavenProject> aggregatedModules = new LinkedHashSet<>();
+
+ for ( Path modulePath : modulePaths )
+ {
+ MavenProject module = reactorProjectsMap.remove( modulePath );
+ if ( module != null )
+ {
+ aggregatedModules.addAll( modulesForAggregatedProject( module, reactorProjectsMap ) );
+ }
+ }
+
+ return aggregatedModules;
+ }
+
/**
* Override this method to customize the configuration for resolving dependency sources. The default
* behavior enables the resolution of -sources jar files.
@@ -2604,10 +2651,13 @@
populateCompileArtifactMap( compileArtifactMap, project.getArtifacts() );
- if ( isAggregator() && project.isExecutionRoot() )
+
+ if ( isAggregator() )
{
+ Collection<MavenProject> aggregatorProjects = getAggregatedProjects();
+
List<String> reactorArtifacts = new ArrayList<>();
- for ( MavenProject p : reactorProjects )
+ for ( MavenProject p : aggregatorProjects )
{
reactorArtifacts.add( p.getGroupId() + ':' + p.getArtifactId() );
}
@@ -2616,7 +2666,7 @@
new PatternExclusionsFilter( reactorArtifacts ),
getDependencyScopeFilter() ) );
- for ( MavenProject subProject : reactorProjects )
+ for ( MavenProject subProject : aggregatorProjects )
{
if ( subProject != project )
{
@@ -4187,9 +4237,9 @@
JavadocUtil.copyJavadocResources( anOutputDirectory, getJavadocDirectory(), excludedocfilessubdir );
}
- if ( isAggregator() && project.isExecutionRoot() )
+ if ( isAggregator() )
{
- for ( MavenProject subProject : reactorProjects )
+ for ( MavenProject subProject : getAggregatedProjects() )
{
if ( subProject != project && getJavadocDirectory() != null )
{
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
index 3478bce..45ee30a 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
@@ -25,9 +25,11 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
- * Bundles the Javadoc documentation for main <code>Java code</code> in an <b>aggregator</b> project into a jar
- * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.
+ * <p>Bundles the Javadoc documentation for main <code>Java code</code> in an <b>aggregator</b> project into a jar
+ * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>
*
+ * <p>Since version 3.1.0 an aggregated jar is created for every module of a Maven multimodule project.</p>
+ *
* @version $Id: AggregatorJavadocJar.java 1749408 2016-06-20 22:54:15Z schulte $
* @since 2.6
*/
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
index 27e0641..cbe2459 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
@@ -25,8 +25,10 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
- * Generates documentation for the <code>Java code</code> in an <b>aggregator</b> project using the standard
- * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.
+ * <p>Generates documentation for the <code>Java code</code> in an <b>aggregator</b> project using the standard
+ * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>
+ *
+ * <p>Since version 3.1.0 an aggregated report is created for every module of a Maven multimodule project.</p>
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id: AggregatorJavadocReport.java 1749408 2016-06-20 22:54:15Z schulte $
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
index 7f8158f..4b1a3b2 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
@@ -25,9 +25,11 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
- * Bundles the Javadoc documentation for <code>Java Test code</code> in an <b>aggregator</b> project into a jar
- * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.
- *
+ * <p>Bundles the Javadoc documentation for <code>Java Test code</code> in an <b>aggregator</b> project into a jar
+ * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>
+ *
+ * <p>Since version 3.1.0 an aggregated jar is created for every module of a Maven multimodule project.</p>
+ *
* @version $Id: AggregatorTestJavadocJar.java 1749408 2016-06-20 22:54:15Z schulte $
* @since 2.6
*/
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
index 8968ce3..ee65a8b 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
@@ -25,9 +25,11 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
/**
- * Generates documentation for the <code>Java Test code</code> in an <b>aggregator</b> project using the standard
- * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.
+ * <p>Generates documentation for the <code>Java Test code</code> in an <b>aggregator</b> project using the standard
+ * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>
*
+ * <p>Since version 3.1.0 an aggregated report is created for every module of a Maven multimodule project.</p>
+ *
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id: AggregatorTestJavadocReport.java 1749408 2016-06-20 22:54:15Z schulte $
* @since 2.5
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
index c343a58..1c57a68 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
@@ -175,7 +175,7 @@
innerDestDir = new File( getOutputDirectory() );
}
- if ( !( "pom".equalsIgnoreCase( project.getPackaging() ) && isAggregator() ) )
+ if ( isAggregator() || !"pom".equalsIgnoreCase( project.getPackaging() ) )
{
ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();
if ( !"java".equals( artifactHandler.getLanguage() ) )
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
index 4fba34f..bbc034f 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
@@ -226,7 +226,7 @@
{
boolean canGenerate = false;
- if ( !this.isAggregator() || this.project.isExecutionRoot() )
+ if ( this.isAggregator() || !"pom".equals( this.project.getPackaging() ) )
{
Collection<String> sourcePaths;
List<String> files;
diff --git a/src/site/apt/examples/aggregate.apt.vm b/src/site/apt/examples/aggregate.apt.vm
index 53d541b..c10e094 100644
--- a/src/site/apt/examples/aggregate.apt.vm
+++ b/src/site/apt/examples/aggregate.apt.vm
@@ -37,9 +37,13 @@
|-- pom.xml
|-- Module1
| `-- pom.xml
- |-- Module2
+ | `-- Module 2
+ | `-- pom.xml
+ | `-- Module 3
+ | `-- pom.xml
+ |-- Module4
| `-- pom.xml
- `-- Module3
+ `-- Module5
`-- pom.xml
+-----+
@@ -50,8 +54,42 @@
<<<aggregate>>> goal instead of.
The {{{../javadoc-mojo.html#aggregate}\<aggregate/\>}} parameter can be used to generate javadocs for multi-module
- projects. It gives the option to
- generate one javadoc report for the entire project (all modules) or generate one javadoc report for each module.
+ projects. It gives the option to generate one javadoc report for the entire project (all modules) or generate one
+ javadoc report for each module. Since 3.1.0 the <<<aggregate>>> has changed a little bit. It'll generate aggregated
+ reports at every level.
+ To get only an aggregated project at root level, you need to configure the pom like:
+
+ +-----+
+<project>
+ ...
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${project.version}</version>
+ <reportSets>
+ <reportSet>
+ <id>aggregate</id>
+ <inherited>false</inherited>
+ <reports>
+ <report>aggregate</report>
+ </reports>
+ </reportSet>
+ <reportSet>
+ <id>default</id>
+ <reports>
+ <report>javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ ...
+ </reporting>
+ ...
+</project>
++-----+
When you execute javadoc:javadoc from Project directory with aggregate set to <<true>>, a javadoc report will be created
in the target directory of Project with all the javadocs of Project's modules included. If aggregate is
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
index e418a20..24b2263 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
@@ -21,6 +21,7 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.maven.model.Build;
@@ -57,17 +58,22 @@
setCompileSourceRoots( compileSourceRoots );
}
- /** {@inheritDoc} */
@Override
public File getBasedir()
{
return new File( super.getBasedir() + "/src/test/resources/unit/aggregate-resources-test" );
}
- /** {@inheritDoc} */
@Override
public MavenProject getExecutionProject()
{
return this;
}
+
+ @Override
+ public List<String> getModules()
+ {
+ return Arrays.asList( "project1", "project2" );
+ }
+
}
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
index 9737634..b43c30e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
@@ -21,6 +21,7 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.maven.model.Build;
@@ -57,31 +58,33 @@
setCompileSourceRoots( compileSourceRoots );
}
- /** {@inheritDoc} */
@Override
public Build getBuild()
{
return build;
}
- /** {@inheritDoc} */
@Override
public void setBuild( Build build )
{
this.build = build;
}
- /** {@inheritDoc} */
@Override
public File getBasedir()
{
return new File( super.getBasedir() + "/src/test/resources/unit/aggregate-test" );
}
- /** {@inheritDoc} */
@Override
public MavenProject getExecutionProject()
{
return this;
}
+
+ @Override
+ public List<String> getModules()
+ {
+ return Arrays.asList( "project1", "project2" );
+ }
}