You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2013/05/08 14:25:12 UTC

svn commit: r1480247 - in /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site: AbstractDeployMojo.java SiteStageMojo.java

Author: hboutemy
Date: Wed May  8 12:25:12 2013
New Revision: 1480247

URL: http://svn.apache.org/r1480247
Log:
renamed getTopLevelProject() to getExecutionRootProject() to avoid misleading "top level" (which is a different notion from the notion used in getRootSite())

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java?rev=1480247&r1=1480246&r2=1480247&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java Wed May  8 12:25:12 2013
@@ -305,30 +305,30 @@ public abstract class AbstractDeployMojo
     }
 
     /**
-     * Find the build directory of the top level project in the reactor.
-     * If no top level project is found, the build directory of the current project is returned.
+     * Find the build directory of the execution root project in the reactor.
+     * If no execution root project is found, the build directory of the current project is returned.
      *
-     * @return the build directory of the top level project.
+     * @return the build directory of the execution root project.
      */
-    protected File getTopLevelBuildDirectory()
+    protected File getExecutionRootBuildDirectory()
     {
         // Find the top level project in the reactor
-        final MavenProject topLevelProject = getTopLevelProject( reactorProjects );
+        final MavenProject executionRootProject = getExecutionRootProject( reactorProjects );
 
         // Use the top level project's build directory if there is one, otherwise use this project's build directory
         final File buildDirectory;
 
-        if ( topLevelProject == null )
+        if ( executionRootProject == null )
         {
-            getLog().debug( "No top level project found in the reactor, using the current project." );
+            getLog().debug( "No execution root project found in the reactor, using the current project." );
 
             buildDirectory = new File( project.getBuild().getDirectory() );
         }
         else
         {
-            getLog().debug( "Using the top level project found in the reactor." );
+            getLog().debug( "Using the execution root project found in the reactor: " + executionRootProject.getArtifactId() );
 
-            buildDirectory = new File( topLevelProject.getBuild().getDirectory() );
+            buildDirectory = new File( executionRootProject.getBuild().getDirectory() );
         }
 
         return buildDirectory;
@@ -741,12 +741,12 @@ public abstract class AbstractDeployMojo
     }
 
     /**
-     * Find the top level parent in the reactor, i.e. the execution root.
+     * Find the execution root in the reactor.
      *
-     * @param reactorProjects The projects in the reactor. May be null in which case null is returned.
-     * @return The top level project in the reactor, or <code>null</code> if none can be found
+     * @param reactorProjects The projects in the reactor. May be <code>null</code> in which case <code>null</code> is returned.
+     * @return The execution root project in the reactor, or <code>null</code> if none can be found
      */
-    private static MavenProject getTopLevelProject( List<MavenProject> reactorProjects )
+    private static MavenProject getExecutionRootProject( List<MavenProject> reactorProjects )
     {
         if ( reactorProjects == null )
         {

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java?rev=1480247&r1=1480246&r2=1480247&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java Wed May  8 12:25:12 2013
@@ -112,26 +112,26 @@ public class SiteStageMojo
      */
     private String getStagingDirectory( String usersStagingDirectory )
     {
-        String topLevelURL = null;
+        String stagingDirectory = null;
 
         if ( usersStagingDirectory != null )
         {
             // the user has specified a stagingDirectory - use it
             getLog().debug( "stagingDirectory specified by the user: " + usersStagingDirectory );
-            topLevelURL = usersStagingDirectory;
+            stagingDirectory = usersStagingDirectory;
         }
         else
         {
             // The user didn't specify a URL, use the top level target dir
-            topLevelURL =
-                getTopLevelBuildDirectory().getAbsolutePath() + "/" + DEFAULT_STAGING_DIRECTORY;
-            getLog().debug( "stagingDirectory NOT specified, using the top level project: " + topLevelURL );
+            stagingDirectory =
+                getExecutionRootBuildDirectory().getAbsolutePath() + "/" + DEFAULT_STAGING_DIRECTORY;
+            getLog().debug( "stagingDirectory NOT specified, using the execution root project: " + stagingDirectory );
         }
 
         // Return either
         //   usersURL
         // or
-        //   topLevelProjectURL + "staging"
-        return topLevelURL;
+        //   executionRootProjectURL + "staging"
+        return stagingDirectory;
     }
 }