# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /Users/hartmut/Development/hudson/trunk/hudson/main/core
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: src/main/java/hudson/maven/reporters/MavenJavadocArchiver.java
--- src/main/java/hudson/maven/reporters/MavenJavadocArchiver.java Base (BASE)
+++ src/main/java/hudson/maven/reporters/MavenJavadocArchiver.java Locally Modified (Based On LOCAL)
@@ -28,13 +28,14 @@
  */
 public class MavenJavadocArchiver extends MavenReporter {
     public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener, Throwable error) throws InterruptedException, IOException {
-        if(!mojo.is("org.apache.maven.plugins","maven-javadoc-plugin","javadoc"))
+        if(!mojo.is("org.apache.maven.plugins","maven-javadoc-plugin","javadoc") &&
+           !mojo.is("org.apache.maven.plugins","maven-javadoc-plugin","aggregate")  )
             return true;
 
         File destDir;
         boolean aggregated;
         try {
-            aggregated = mojo.getConfigurationValue("aggregate",Boolean.class);
+            aggregated = mojo.getConfigurationValue("aggregate",Boolean.class) || mojo.getGoal().equals("aggregate");
             if(aggregated && !pom.isExecutionRoot())
                 return true;    // in the aggregated mode, the generation will only happen for the root module
 
@@ -50,16 +51,18 @@
         if(destDir.exists()) {
             // javadoc:javadoc just skips itself when the current project is not a java project 
             FilePath target;
-            if(aggregated)
+            if(aggregated) {
                 // store at MavenModuleSet level. 
+                listener.getLogger().println("[HUDSON] Archiving aggregated javadoc");
                 target = build.getModuleSetRootDir();
-            else
+            } else {
+                listener.getLogger().println("[HUDSON] Archiving javadoc");
                 target = build.getProjectRootDir();
+            }
 
             target = target.child("javadoc");
 
             try {
-                listener.getLogger().println("[HUDSON] Archiving javadoc");
                 new FilePath(destDir).copyRecursiveTo("**/*",target);
             } catch (IOException e) {
                 Util.displayIOException(e,listener);