You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2011/03/01 12:22:08 UTC

svn commit: r1075782 - in /maven/plugins/trunk/maven-site-plugin/src: it/MSITE-304/ it/MSITE-537/ it/MSITE-537/parent/ it/site-inheritance/ it/site-inheritance/aggregator/ it/site-inheritance/child_and_module/ it/site-inheritance/child_and_module/src/ ...

Author: ltheussl
Date: Tue Mar  1 11:22:06 2011
New Revision: 1075782

URL: http://svn.apache.org/viewvc?rev=1075782&view=rev
Log:
[MSITE-537] site:stage-deploy creates wrong directory structure if run from a sub-module

Added:
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/invoker.properties
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/verify.bsh
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/index.apt
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/site.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/index.apt
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/site.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/invoker.properties
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/index.apt
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/site.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/index.apt
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/site.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/index.apt
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/site.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/verify.bsh
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/invoker.properties
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/verify.bsh
Removed:
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/goals.txt
Modified:
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/invoker.properties
    maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/verify.bsh
    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/SiteStageDeployMojo.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/it/MSITE-304/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/invoker.properties?rev=1075782&r1=1075781&r2=1075782&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/invoker.properties (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/invoker.properties Tue Mar  1 11:22:06 2011
@@ -1 +1,3 @@
 invoker.maven.version = 3.0-
+invoker.goals.1 = clean
+invoker.goals.2 = site:site site:stage site:stage-deploy

Modified: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/verify.bsh?rev=1075782&r1=1075781&r2=1075782&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/verify.bsh (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-304/verify.bsh Tue Mar  1 11:22:06 2011
@@ -39,16 +39,8 @@ try
     }
 
     String tmpDir = System.getProperty( "java.io.tmpdir" );
-    String strippedTmpDir = tmpDir.replaceAll( "[\\:\\?\\*]", "" );
 
-    File parentDirectory = new File ( stagingDirectory, "localhost/" + strippedTmpDir + "/www.example.com/parent" );
-    if ( !parentDirectory.exists() || !parentDirectory.isDirectory() )
-    {
-        System.err.println( "Staging directory for parent '" + parentDirectory + "' is missing or not a directory." );
-        return false;
-    }
-
-    File childDirectory = new File ( stagingDirectory, "localhost/" + strippedTmpDir + "/www.example.com/parent/MSITE-304-child" );
+    File childDirectory = new File ( stagingDirectory, "MSITE-304-child" );
     if ( !childDirectory.exists() || !childDirectory.isDirectory() )
     {
         System.err.println( "Staging directory for child '" + childDirectory + "' is missing or not a directory." );

Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/invoker.properties?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/invoker.properties (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/invoker.properties Tue Mar  1 11:22:06 2011
@@ -0,0 +1,3 @@
+invoker.maven.version = 3.0-
+invoker.goals.1 = clean
+invoker.goals.2 = site:site site:stage-deploy

Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/parent/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,49 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>msite537</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>MSITE-537 :: Parent</name>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/MSITE-537/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>../</module>
+  </modules>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,16 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>msite537</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>parent/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>module</artifactId>
+  <packaging>pom</packaging>
+  <name>MSITE-537</name>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/verify.bsh?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-537/verify.bsh Tue Mar  1 11:22:06 2011
@@ -0,0 +1,49 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    final File stageDeployDirectory = new File ( basedir, "staging" );
+    if ( !stageDeployDirectory.exists() || !stageDeployDirectory.isDirectory() )
+    {
+        System.err.println( "stageDeployDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // module directory
+    final File moduleDirectory = new File ( stageDeployDirectory, "module" );
+    if ( !moduleDirectory.exists() || !moduleDirectory.isDirectory() )
+    {
+        System.err.println( "stage deploy moduleDirectory is missing or not a directory." );
+        return false;
+    }
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/aggregator/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,56 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test-site-inheritance</groupId>
+  <artifactId>aggregator</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Aggregator</name>
+  <url>http://webhost.company.com/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <stagingDirectory>@project.build.directory@/it/site-inheritance/webhost.company.com/staging/</stagingDirectory>
+            <stagingSiteURL>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/staging/</stagingSiteURL>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>../child_and_module</module>
+    <module>../inheriting_child</module>
+    <module>../module</module>
+  </modules>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,26 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>test-site-inheritance</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../parent/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>child_and_module</artifactId>
+  <name>Child and Module</name>
+  <url>http://webhost.company.com/www/website/deep/down/below/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/www/website/deep/down/below/</url>
+    </site>
+  </distributionManagement>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/index.apt?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/apt/index.apt Tue Mar  1 11:22:06 2011
@@ -0,0 +1,11 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ Date Here
+ -----
+
+Maven Site for child
+
+ Congratulations! If you see this, you're awake.
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/site.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/child_and_module/src/site/site.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <body>
+
+    <links>
+      <!-- should all be equivalent -->
+      <item name="links /Child" href="/index.html"/>
+      <item name="links ./Child" href="./index.html"/>
+      <item name="links Child" href="index.html"/>
+    </links>
+
+    <breadcrumbs>
+      <!-- should all be equivalent -->
+      <item name="breadcrumbs /Child" href="/index.html"/>
+      <item name="breadcrumbs ./Child" href="./index.html"/>
+      <item name="breadcrumbs Child" href="index.html"/>
+    </breadcrumbs>
+
+    <menu ref="parent"/>
+    <menu ref="reports"/>
+
+  </body>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,21 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>test-site-inheritance</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../parent</relativePath>
+  </parent>
+
+  <artifactId>inheriting_child</artifactId>
+  <name>Inheriting Child</name>
+
+<!-- same as child_and_module but WITHOUT DEPLOYMENT / STAGING URLs
+        to test they are properly inherited and links are correct -->
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/index.apt?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/apt/index.apt Tue Mar  1 11:22:06 2011
@@ -0,0 +1,11 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ Date Here
+ -----
+
+Maven Site for child
+
+ Congratulations! If you see this, you're awake.
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/site.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/inheriting_child/src/site/site.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <body>
+
+    <links>
+      <!-- should all be equivalent -->
+      <item name="links /Child" href="/index.html"/>
+      <item name="links ./Child" href="./index.html"/>
+      <item name="links Child" href="index.html"/>
+    </links>
+
+    <breadcrumbs>
+      <!-- should all be equivalent -->
+      <item name="breadcrumbs /Child" href="/index.html"/>
+      <item name="breadcrumbs ./Child" href="./index.html"/>
+      <item name="breadcrumbs Child" href="index.html"/>
+    </breadcrumbs>
+
+    <menu ref="parent"/>
+    <menu ref="reports"/>
+
+  </body>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/invoker.properties?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/invoker.properties (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/invoker.properties Tue Mar  1 11:22:06 2011
@@ -0,0 +1,3 @@
+invoker.maven.version = 3.0-
+invoker.goals.1 = clean
+invoker.goals.2 = site:site site:deploy site:stage site:stage-deploy

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,55 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test-site-inheritance</groupId>
+  <artifactId>module</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Module</name>
+  <url>http://webhost.company.com/www/website/module</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/www/website/module</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <stagingDirectory>@project.build.directory@/it/site-inheritance/webhost.company.com/staging/www/website/module</stagingDirectory>
+            <stagingSiteURL>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/staging/www/website/module</stagingSiteURL>
+          </configuration>
+        </plugin>
+      </plugins>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>../sub_module</module>
+  </modules>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/index.apt?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/apt/index.apt Tue Mar  1 11:22:06 2011
@@ -0,0 +1,11 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ Date Here
+ -----
+
+Maven Site for child
+
+ Congratulations! If you see this, you're awake.
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/site.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/module/src/site/site.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <body>
+
+    <links>
+      <!-- should all be equivalent -->
+      <item name="links /Module" href="/index.html"/>
+      <item name="links ./Module" href="./index.html"/>
+      <item name="links Module" href="index.html"/>
+    </links>
+
+    <breadcrumbs>
+      <!-- should all be equivalent -->
+      <item name="breadcrumbs /Module" href="/index.html"/>
+      <item name="breadcrumbs ./Module" href="./index.html"/>
+      <item name="breadcrumbs Module" href="index.html"/>
+    </breadcrumbs>
+
+    <menu ref="parent"/>
+    <menu ref="modules"/>
+    <menu ref="reports"/>
+
+  </body>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,50 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test-site-inheritance</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Parent</name>
+  <url>http://webhost.company.com/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <stagingDirectory>@project.build.directory@/it/site-inheritance/webhost.company.com/staging/</stagingDirectory>
+            <stagingSiteURL>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/staging/</stagingSiteURL>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/index.apt?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/apt/index.apt Tue Mar  1 11:22:06 2011
@@ -0,0 +1,11 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ Date Here
+ -----
+
+Maven Site for parent
+
+ Congratulations! If you see this, you're awake!
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/site.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/parent/src/site/site.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <body>
+
+    <links>
+      <!-- should all be equivalent -->
+      <item name="links /Parent" href="/index.html"/>
+      <item name="links ./Parent" href="./index.html"/>
+      <item name="links Parent" href="index.html"/>
+    </links>
+
+    <breadcrumbs>
+      <!-- should all be equivalent -->
+      <item name="breadcrumbs /Parent" href="/index.html"/>
+      <item name="breadcrumbs ./Parent" href="./index.html"/>
+      <item name="breadcrumbs Parent" href="index.html"/>
+    </breadcrumbs>
+
+    <menu ref="modules"/>
+    <menu ref="reports"/>
+
+  </body>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,54 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>test-site-inheritance</groupId>
+  <artifactId>top</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>Top</name>
+  <url>http://webhost.company.com/junk/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/junk/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <stagingDirectory>@project.build.directory@/it/site-inheritance/webhost.company.com/staging/junk/</stagingDirectory>
+            <stagingSiteURL>file://@project.build.directory@/it/site-inheritance/webhost.company.com/deploy/staging/junk/</stagingSiteURL>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>aggregator</module>
+  </modules>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,15 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>test-site-inheritance</groupId>
+    <artifactId>module</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../module</relativePath>
+  </parent>
+
+  <artifactId>sub_module</artifactId>
+  <name>Sub-Module</name>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/index.apt?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/index.apt (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/apt/index.apt Tue Mar  1 11:22:06 2011
@@ -0,0 +1,11 @@
+ -----
+ Title Here
+ -----
+ Author Here
+ -----
+ Date Here
+ -----
+
+Maven Site for child
+
+ Congratulations! If you see this, you're awake.
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/site.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/site.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/sub_module/src/site/site.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project name="Maven" xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <body>
+
+    <links>
+      <!-- should all be equivalent -->
+      <item name="links /SubModule" href="/index.html"/>
+      <item name="links ./SubModule" href="./index.html"/>
+      <item name="links SubModule" href="index.html"/>
+    </links>
+
+    <breadcrumbs>
+      <!-- should all be equivalent -->
+      <item name="breadcrumbs /SubModule" href="/index.html"/>
+      <item name="breadcrumbs ./SubModule" href="./index.html"/>
+      <item name="breadcrumbs SubModule" href="index.html"/>
+    </breadcrumbs>
+
+    <menu ref="parent"/>
+    <menu ref="reports"/>
+
+  </body>
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/verify.bsh?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-inheritance/verify.bsh Tue Mar  1 11:22:06 2011
@@ -0,0 +1,564 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    final File siteDirectory = new File ( basedir, "webhost.company.com" );
+    if ( !siteDirectory.exists() || !siteDirectory.isDirectory() )
+    {
+        System.err.println( "site is missing or not a directory." );
+        return false;
+    }
+
+    final File deployDirectory = new File ( siteDirectory, "deploy" );
+    if ( !deployDirectory.exists() || !deployDirectory.isDirectory() )
+    {
+        System.err.println( "deployDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // junk directory (aggregator)
+    File junkDirectory = new File ( deployDirectory, "junk" );
+    if ( !junkDirectory.exists() || !junkDirectory.isDirectory() )
+    {
+        System.err.println( "junkDirectory is missing or not a directory." );
+        return false;
+    }
+
+    File index = new File ( junkDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in junk or is a directory." );
+        return false;
+    }
+
+    String content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int indexOf = content.indexOf( "<a href=\"../index.html\" title=\"Aggregator\">Aggregator</a>" );
+    if ( indexOf < 0)
+    {
+        System.err.println( "junk index.html is missing module link!" );
+        return false;
+    }
+
+    // deploy directory (main site)
+    index = new File ( deployDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in deploy or is a directory." );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int index1 = content.indexOf( "<a href=\"www/website/deep/down/below/index.html\" title=\"Child and Module\">Child and Module</a>" );
+    int index2 = content.indexOf( "<a href=\"inheriting_child/index.html\" title=\"Inheriting Child\">Inheriting Child</a>" );
+    int index3 = content.indexOf( "<a href=\"www/website/module/index.html\" title=\"Module\">Module</a>" );
+    int index4 = content.indexOf( "<a href=\"\" title=\"Aggregator\">Aggregator</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "deploy index.html is missing module link!" );
+        return false;
+    }
+
+    // parent directory
+    File parentDirectory = new File ( deployDirectory, "www/website" );
+    if ( !parentDirectory.exists() || !parentDirectory.isDirectory() )
+    {
+        System.err.println( "parentDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( parentDirectory, "index.html" );
+    if ( index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in parent!" );
+        return false;
+    }
+
+    // child_and_module
+    File deepDownBelow = new File ( parentDirectory, "deep/down/below" );
+    if ( !deepDownBelow.exists() || !deepDownBelow.isDirectory() )
+    {
+        System.err.println( "deepDownBelow is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( deepDownBelow, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in deepDownBelow!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"breadcrumbs Parent\">breadcrumbs Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs /Child\">breadcrumbs /Child</a>" );
+    index3 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"links ./Parent\">links ./Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "deepDownBelow index.html is missing links!" );
+        return false;
+    }
+
+    // inheriting_child
+    File inheritingChild = new File ( deployDirectory, "inheriting_child" );
+    if ( !inheritingChild.exists() || !inheritingChild.isDirectory() )
+    {
+        System.err.println( "inheritingChild is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( inheritingChild, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in inheritingChild!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../index.html\" title=\"breadcrumbs /Parent\">breadcrumbs /Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./Child\">breadcrumbs ./Child</a>" );
+    index3 = content.indexOf( "<a href=\"../index.html\" title=\"links Parent\">links Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "inheritingChild index.html is missing links!" );
+        return false;
+    }
+
+    // module
+    File moduleDirectory = new File ( parentDirectory, "module" );
+    if ( !moduleDirectory.exists() || !moduleDirectory.isDirectory() )
+    {
+        System.err.println( "moduleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( moduleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in moduleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs Module\">breadcrumbs Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"links ./Module\">links ./Module</a>" );
+    index3 = content.indexOf( "<a href=\"../sub_module/index.html\" title=\"Sub-Module\">Sub-Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+
+    // sub_module
+    File subModuleDirectory = new File ( parentDirectory, "sub_module" );
+    if ( !subModuleDirectory.exists() || !subModuleDirectory.isDirectory() )
+    {
+        System.err.println( "subModuleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( subModuleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in subModuleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../module/index.html\" title=\"breadcrumbs /Module\">breadcrumbs /Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./SubModule\">breadcrumbs ./SubModule</a>" );
+    index3 = content.indexOf( "<a href=\"../module/index.html\" title=\"links Module\">links Module</a>" );
+    index4 = content.indexOf( "<a href=\"../module/index.html\" title=\"Module\">Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+
+    // STAGING
+
+
+    final File stageDirectory = new File ( siteDirectory, "staging" );
+    if ( !stageDirectory.exists() || !stageDirectory.isDirectory() )
+    {
+        System.err.println( "stageDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // the created directory structure in
+    //      target/it/site-inheritance/webhost.company.com/staging/
+    // should match the deploy structure in
+    //      target/it/site-inheritance/webhost.company.com/deploy/
+
+
+    // junk directory (aggregator)
+    junkDirectory = new File ( stageDirectory, "junk" );
+    if ( !junkDirectory.exists() || !junkDirectory.isDirectory() )
+    {
+        System.err.println( "staging junkDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( junkDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in staging junk or is a directory." );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int indexOf = content.indexOf( "<a href=\"../index.html\" title=\"Aggregator\">Aggregator</a>" );
+    if ( indexOf < 0)
+    {
+        System.err.println( "staging junk index.html is missing module link!" );
+        return false;
+    }
+
+    // deploy directory (main site)
+    index = new File ( stageDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in staging or is a directory." );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int index1 = content.indexOf( "<a href=\"www/website/deep/down/below/index.html\" title=\"Child and Module\">Child and Module</a>" );
+    int index2 = content.indexOf( "<a href=\"inheriting_child/index.html\" title=\"Inheriting Child\">Inheriting Child</a>" );
+    int index3 = content.indexOf( "<a href=\"www/website/module/index.html\" title=\"Module\">Module</a>" );
+    int index4 = content.indexOf( "<a href=\"\" title=\"Aggregator\">Aggregator</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "staging index.html is missing module link!" );
+        return false;
+    }
+
+    // parent directory
+    parentDirectory = new File ( stageDirectory, "www/website" );
+    if ( !parentDirectory.exists() || !parentDirectory.isDirectory() )
+    {
+        System.err.println( "staging parentDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( parentDirectory, "index.html" );
+    if ( index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect staging index file in parent!" );
+        return false;
+    }
+
+    // child_and_module
+    deepDownBelow = new File ( parentDirectory, "deep/down/below" );
+    if ( !deepDownBelow.exists() || !deepDownBelow.isDirectory() )
+    {
+        System.err.println( "staging deepDownBelow is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( deepDownBelow, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in staging deepDownBelow!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"breadcrumbs Parent\">breadcrumbs Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs /Child\">breadcrumbs /Child</a>" );
+    index3 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"links ./Parent\">links ./Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "staging deepDownBelow index.html is missing links!" );
+        return false;
+    }
+
+    // inheriting_child
+    inheritingChild = new File ( stageDirectory, "inheriting_child" );
+    if ( !inheritingChild.exists() || !inheritingChild.isDirectory() )
+    {
+        System.err.println( "staging inheritingChild is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( inheritingChild, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in staging inheritingChild!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../index.html\" title=\"breadcrumbs /Parent\">breadcrumbs /Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./Child\">breadcrumbs ./Child</a>" );
+    index3 = content.indexOf( "<a href=\"../index.html\" title=\"links Parent\">links Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "staging inheritingChild index.html is missing links!" );
+        return false;
+    }
+
+    // module
+    moduleDirectory = new File ( parentDirectory, "module" );
+    if ( !moduleDirectory.exists() || !moduleDirectory.isDirectory() )
+    {
+        System.err.println( "staging moduleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( moduleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in staging moduleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs Module\">breadcrumbs Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"links ./Module\">links ./Module</a>" );
+    index3 = content.indexOf( "<a href=\"../sub_module/index.html\" title=\"Sub-Module\">Sub-Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "staging moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+
+    // sub_module
+    subModuleDirectory = new File ( parentDirectory, "sub_module" );
+    if ( !subModuleDirectory.exists() || !subModuleDirectory.isDirectory() )
+    {
+        System.err.println( "staging subModuleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( subModuleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in staging subModuleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../module/index.html\" title=\"breadcrumbs /Module\">breadcrumbs /Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./SubModule\">breadcrumbs ./SubModule</a>" );
+    index3 = content.indexOf( "<a href=\"../module/index.html\" title=\"links Module\">links Module</a>" );
+    index4 = content.indexOf( "<a href=\"../module/index.html\" title=\"Module\">Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "staging moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+    // STAGE DEPLOY
+
+
+    final File stageDeployDirectory = new File ( deployDirectory, "staging" );
+    if ( !stageDeployDirectory.exists() || !stageDeployDirectory.isDirectory() )
+    {
+        System.err.println( "stageDeployDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // the created directory structure in
+    //      target/it/site-inheritance/webhost.company.com/deploy/staging/
+    // should match the deploy structure in
+    //      target/it/site-inheritance/webhost.company.com/deploy/
+
+    // junk directory (aggregator)
+    junkDirectory = new File ( stageDeployDirectory, "junk" );
+    if ( !junkDirectory.exists() || !junkDirectory.isDirectory() )
+    {
+        System.err.println( "stagedeploy junkDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( junkDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in stagedeploy junk or is a directory." );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int indexOf = content.indexOf( "<a href=\"../index.html\" title=\"Aggregator\">Aggregator</a>" );
+    if ( indexOf < 0)
+    {
+        System.err.println( "stagedeploy junk index.html is missing module link!" );
+        return false;
+    }
+
+    // deploy directory (main site)
+    index = new File ( stageDeployDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "no index file in stagedeploy or is a directory." );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    int index1 = content.indexOf( "<a href=\"www/website/deep/down/below/index.html\" title=\"Child and Module\">Child and Module</a>" );
+    int index2 = content.indexOf( "<a href=\"inheriting_child/index.html\" title=\"Inheriting Child\">Inheriting Child</a>" );
+    int index3 = content.indexOf( "<a href=\"www/website/module/index.html\" title=\"Module\">Module</a>" );
+    int index4 = content.indexOf( "<a href=\"\" title=\"Aggregator\">Aggregator</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "stagedeploy index.html is missing module link!" );
+        return false;
+    }
+
+    // parent directory
+    parentDirectory = new File ( stageDeployDirectory, "www/website" );
+    if ( !parentDirectory.exists() || !parentDirectory.isDirectory() )
+    {
+        System.err.println( "stagedeploy parentDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( parentDirectory, "index.html" );
+    if ( index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in stagedeploy parent!" );
+        return false;
+    }
+
+    // child_and_module
+    deepDownBelow = new File ( parentDirectory, "deep/down/below" );
+    if ( !deepDownBelow.exists() || !deepDownBelow.isDirectory() )
+    {
+        System.err.println( "stagedeploy deepDownBelow is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( deepDownBelow, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in stagedeploy deepDownBelow!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"breadcrumbs Parent\">breadcrumbs Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs /Child\">breadcrumbs /Child</a>" );
+    index3 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"links ./Parent\">links ./Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../../../../../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "stagedeploy deepDownBelow index.html is missing links!" );
+        return false;
+    }
+
+    // inheriting_child
+    inheritingChild = new File ( stageDeployDirectory, "inheriting_child" );
+    if ( !inheritingChild.exists() || !inheritingChild.isDirectory() )
+    {
+        System.err.println( "stagedeploy inheritingChild is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( inheritingChild, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in stagedeploy inheritingChild!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../index.html\" title=\"breadcrumbs /Parent\">breadcrumbs /Parent</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./Child\">breadcrumbs ./Child</a>" );
+    index3 = content.indexOf( "<a href=\"../index.html\" title=\"links Parent\">links Parent</a>" );
+    index4 = content.indexOf( "<a href=\"../index.html\" title=\"Parent\">Parent</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 || index4 < 0 )
+    {
+        System.err.println( "stagedeploy inheritingChild index.html is missing links!" );
+        return false;
+    }
+
+    // module
+    moduleDirectory = new File ( parentDirectory, "module" );
+    if ( !moduleDirectory.exists() || !moduleDirectory.isDirectory() )
+    {
+        System.err.println( "stagedeploy moduleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( moduleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in stagedeploy moduleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs Module\">breadcrumbs Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"links ./Module\">links ./Module</a>" );
+    index3 = content.indexOf( "<a href=\"../sub_module/index.html\" title=\"Sub-Module\">Sub-Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "stagedeploy moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+
+    // sub_module
+    subModuleDirectory = new File ( parentDirectory, "sub_module" );
+    if ( !subModuleDirectory.exists() || !subModuleDirectory.isDirectory() )
+    {
+        System.err.println( "stagedeploy subModuleDirectory is missing or not a directory." );
+        return false;
+    }
+
+    index = new File ( subModuleDirectory, "index.html" );
+    if ( !index.exists() || index.isDirectory() )
+    {
+        System.err.println( "incorrect index file in stagedeploy subModuleDirectory!" );
+        return false;
+    }
+
+    content = IOUtil.toString ( new FileInputStream ( index ), "UTF-8" );
+    index1 = content.indexOf( "<a href=\"../module/index.html\" title=\"breadcrumbs /Module\">breadcrumbs /Module</a>" );
+    index2 = content.indexOf( "<a href=\"index.html\" title=\"breadcrumbs ./SubModule\">breadcrumbs ./SubModule</a>" );
+    index3 = content.indexOf( "<a href=\"../module/index.html\" title=\"links Module\">links Module</a>" );
+    index4 = content.indexOf( "<a href=\"../module/index.html\" title=\"Module\">Module</a>" );
+    if ( index1 < 0 || index2 < 0 || index3 < 0 )
+    {
+        System.err.println( "stagedeploy moduleDirectory index.html has wrong links!" );
+        return false;
+    }
+
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/invoker.properties?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/invoker.properties (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/invoker.properties Tue Mar  1 11:22:06 2011
@@ -0,0 +1,3 @@
+invoker.maven.version = 3.0-
+invoker.goals.1 = clean
+invoker.goals.2 = site:site site:deploy site:stage site:stage-deploy

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/maven-rocks-plugin/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>site-plugin-its</groupId>
+    <artifactId>plugins</artifactId>
+    <version>1-SNAPSHOT</version>
+    <relativePath>../plugins/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>maven-rocks-plugin</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Rocks Plugin</name>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/plugins/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>site-plugin-its</groupId>
+    <artifactId>pom</artifactId>
+    <version>1-SNAPSHOT</version>
+    <relativePath>../../pom/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>plugins</artifactId>
+  <version>1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>Plugins - Parent</name>
+
+  <!-- distMngmnt is inherited from parent -->
+
+</project>
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/plugins/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>site-plugin-its</groupId>
+    <artifactId>pom</artifactId>
+    <version>1-SNAPSHOT</version>
+    <relativePath>../pom/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>aggregator</artifactId>
+  <version>1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>Plugins</name>
+  <url>http://example.net/plugins/</url>
+
+  <distributionManagement>
+    <!-- override parent because artifactId does not match -->
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-stage-deploy/deploy/plugins/</url>
+    </site>
+  </distributionManagement>
+
+  <modules>
+    <module>maven-rocks-plugin</module>
+  </modules>
+
+</project>
\ No newline at end of file

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>site-plugin-its</groupId>
+  <artifactId>stage-deploy</artifactId>
+  <version>1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>Aggregator</name>
+  <url>http://example.net/junk/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-stage-deploy/deploy/junk/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.3.1</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>plugins</module>
+  </modules>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/pom.xml?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/pom/pom.xml Tue Mar  1 11:22:06 2011
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>site-plugin-its</groupId>
+  <artifactId>pom</artifactId>
+  <version>1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>POM</name>
+
+  <url>http://example.net/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/site-stage-deploy/deploy/</url>
+    </site>
+  </distributionManagement>
+
+</project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/verify.bsh?rev=1075782&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-stage-deploy/verify.bsh Tue Mar  1 11:22:06 2011
@@ -0,0 +1,115 @@
+
+/*
+ * 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.
+ */
+
+import java.io.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    final File deployDirectory = new File ( basedir, "deploy" );
+    if ( !deployDirectory.exists() || !deployDirectory.isDirectory() )
+    {
+        System.err.println( "deployDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // junk directory (aggregator)
+    File junkDirectory = new File ( deployDirectory, "junk" );
+    if ( !junkDirectory.exists() || !junkDirectory.isDirectory() )
+    {
+        System.err.println( "junkDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugins directory
+    File pluginsDirectory = new File ( deployDirectory, "plugins" );
+    if ( !pluginsDirectory.exists() || !pluginsDirectory.isDirectory() )
+    {
+        System.err.println( "deploy pluginsDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugin
+    File mavenRocksDirectory = new File ( pluginsDirectory, "maven-rocks-plugin" );
+    if ( !mavenRocksDirectory.exists() || !mavenRocksDirectory.isDirectory() )
+    {
+        System.err.println( "deploy mavenRocksDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // STAGING
+
+    final File stageDirectory = new File ( basedir, "target/staging" );
+    if ( !stageDirectory.exists() || !stageDirectory.isDirectory() )
+    {
+        System.err.println( "stageDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugins directory
+    pluginsDirectory = new File ( stageDirectory, "plugins" );
+    if ( !pluginsDirectory.exists() || !pluginsDirectory.isDirectory() )
+    {
+        System.err.println( "staging pluginsDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugin
+    mavenRocksDirectory = new File ( pluginsDirectory, "maven-rocks-plugin" );
+    if ( !mavenRocksDirectory.exists() || !mavenRocksDirectory.isDirectory() )
+    {
+        System.err.println( "staging mavenRocksDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // STAGE DEPLOY
+
+    final File stageDeployDirectory = new File ( basedir, "deploy/staging" );
+    if ( !stageDeployDirectory.exists() || !stageDeployDirectory.isDirectory() )
+    {
+        System.err.println( "stageDeployDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugins directory
+    pluginsDirectory = new File ( stageDeployDirectory, "plugins" );
+    if ( !pluginsDirectory.exists() || !pluginsDirectory.isDirectory() )
+    {
+        System.err.println( "stage deploy pluginsDirectory is missing or not a directory." );
+        return false;
+    }
+
+    // plugin
+    mavenRocksDirectory = new File ( pluginsDirectory, "maven-rocks-plugin" );
+    if ( !mavenRocksDirectory.exists() || !mavenRocksDirectory.isDirectory() )
+    {
+        System.err.println( "stage deploy mavenRocksDirectory is missing or not a directory." );
+        return false;
+    }
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

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=1075782&r1=1075781&r2=1075782&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 Tue Mar  1 11:22:06 2011
@@ -497,4 +497,28 @@ public abstract class AbstractDeployMojo
 
         return null;
     }
+
+    /**
+     * Return the top level parent of the given project.
+     *
+     * @param project the MavenProject. May be null in which case null is returned.
+     *
+     * @return the upper-most parent MavenProject, or the original project if it has no parent.
+     */
+    protected static MavenProject getTopLevelParent( final MavenProject project )
+    {
+        if ( project == null )
+        {
+            return null;
+        }
+
+        MavenProject parent = project;
+
+        while ( parent.getParent() != null )
+        {
+            parent = parent.getParent();
+        }
+
+        return parent;
+    }
 }

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java?rev=1075782&r1=1075781&r2=1075782&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java Tue Mar  1 11:22:06 2011
@@ -19,7 +19,6 @@ package org.apache.maven.plugins.site;
  * under the License.
  */
 
-import java.util.List;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
@@ -80,7 +79,7 @@ public class SiteStageDeployMojo
     protected String getDeployRepositoryURL()
         throws MojoExecutionException
     {
-        stagingSiteURL = getStagingSiteURL( project, reactorProjects, stagingSiteURL );
+        stagingSiteURL = getStagingSiteURL( project, stagingSiteURL );
 
         getLog().info( "Using this URL for stage deploy: " + stagingSiteURL );
 
@@ -95,7 +94,7 @@ public class SiteStageDeployMojo
      * @param usersStagingSiteURL The staging site URL as suggested by the user's configuration
      * @return the site URL for staging
      */
-    private String getStagingSiteURL( MavenProject currentProject, List<MavenProject> reactorProjects,
+    private String getStagingSiteURL( MavenProject currentProject,
                                         String usersStagingSiteURL )
     {
         String topLevelURL = null;
@@ -104,32 +103,34 @@ public class SiteStageDeployMojo
         // If the user has specified a stagingSiteURL - use it
         if ( usersStagingSiteURL != null )
         {
-            getLog().debug( "stagingSiteURL specified by the user." );
+            getLog().debug( "stagingSiteURL specified by the user: " + usersStagingSiteURL );
             topLevelURL = usersStagingSiteURL;
         }
-        getLog().debug( "stagingSiteURL NOT specified by the user." );
+        else
+        {
+            getLog().debug( "stagingSiteURL NOT specified by the user." );
+        }
 
-        // Find the top level project in the reactor
-        MavenProject topLevelProject = getTopLevelProject( reactorProjects );
+        MavenProject parentProject = getTopLevelParent( currentProject );
 
         // Take the distributionManagement site url from the top level project,
         // if there is one, otherwise take it from the current project
-        if ( topLevelProject == null )
+        if ( parentProject == null )
         {
             if ( topLevelURL == null )
             {
                 // The user didn't specify a URL and there is no top level project in the reactor
                 // Use current project
-                getLog().debug( "No top level project found in the reactor, using the current project." );
                 topLevelURL =
                     currentProject.getDistributionManagement().getSite().getUrl() + "/" + DEFAULT_STAGING_DIRECTORY;
+                getLog().debug( "No top level project found in the reactor, using the current project: " + topLevelURL );
             }
         }
         else
         {
             // Find the relative path between the parent and child distribution URLs, if any
             relative = "/" + siteTool.getRelativePath( currentProject.getDistributionManagement().getSite().getUrl(),
-                                                       topLevelProject.getDistributionManagement().getSite().getUrl() );
+                                                       parentProject.getDistributionManagement().getSite().getUrl() );
             // SiteTool.getRelativePath() uses File.separatorChar, so we need to convert '\' to '/' in order for the URL
             // to be valid for Windows users
             relative = relative.replace( '\\', '/' );
@@ -138,9 +139,9 @@ public class SiteStageDeployMojo
             {
                 // The user didn't specify a URL and there is a top level project in the reactor
                 // Use the top level project
-                getLog().debug( "Using the top level project found in the reactor." );
                 topLevelURL =
-                    topLevelProject.getDistributionManagement().getSite().getUrl() + "/" + DEFAULT_STAGING_DIRECTORY;
+                    parentProject.getDistributionManagement().getSite().getUrl() + "/" + DEFAULT_STAGING_DIRECTORY;
+                getLog().debug( "Using the top level project: " + topLevelURL );
             }
         }
 

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=1075782&r1=1075781&r2=1075782&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 Tue Mar  1 11:22:06 2011
@@ -21,15 +21,8 @@ package org.apache.maven.plugins.site;
 
 import java.io.File;
 
-import java.util.List;
-
-import org.apache.maven.model.Site;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.plugins.site.wagon.repository.Repository;
-
-import org.codehaus.plexus.util.StringUtils;
 
 /**
  * Generates a site in a local staging or mock directory based on the site URL
@@ -70,27 +63,12 @@ public class SiteStageMojo
     protected String getDeployRepositoryURL()
         throws MojoExecutionException
     {
-        String structureProject;
-
-        try
-        {
-            structureProject = getStructure( project, false );
-        }
-        catch ( MojoFailureException ex )
-        {
-            throw new MojoExecutionException( "Missing site information.", ex );
-        }
-
-        if ( structureProject == null )
-        {
-            throw new MojoExecutionException( "Missing site information." );
-        }
+        final String stageDir = ( stagingDirectory == null ) ? null : stagingDirectory.getAbsolutePath();
+        final String outputDir = getStagingDirectory( project, stageDir );
 
-        stagingDirectory = getStagingDirectory( project, reactorProjects, stagingDirectory );
-        getLog().info( "Using this directory for staging: " + stagingDirectory );
-
-        final File outputDirectory = new File( stagingDirectory, structureProject );
+        getLog().info( "Using this directory for staging: " + outputDir );
 
+        final File outputDirectory = new File( outputDir );
         // Safety
         if ( !outputDirectory.exists() )
         {
@@ -108,81 +86,61 @@ public class SiteStageMojo
      * @param usersStagingDirectory The staging directory as suggested by the user's configuration
      * @return the directory for staging
      */
-    private File getStagingDirectory( MavenProject currentProject, List<MavenProject> reactorProjects,
-                                        File usersStagingDirectory )
+    private String getStagingDirectory( MavenProject currentProject,
+                                        String usersStagingDirectory )
     {
-        // Check if the user has specified a stagingDirectory
+        String topLevelURL = null;
+        String relative = "";
+
+        // If the user has specified a stagingDirectory - use it
         if ( usersStagingDirectory != null )
         {
-            getLog().debug( "stagingDirectory specified by the user." );
-            return usersStagingDirectory;
+            getLog().debug( "stagingDirectory specified by the user: " + usersStagingDirectory );
+            topLevelURL = usersStagingDirectory;
         }
-        getLog().debug( "stagingDirectory NOT specified by the user." );
-
-        return new File( getTopLevelBuildDirectory(), DEFAULT_STAGING_DIRECTORY );
-    }
-
-    /**
-     * Generates the site structure using the project hiearchy (project and its modules) or using the
-     * distributionManagement elements from the pom.xml.
-     *
-     * @param project
-     * @param ignoreMissingSiteUrl
-     * @return the structure relative path
-     * @throws MojoFailureException if any
-     */
-    private static String getStructure( MavenProject project, boolean ignoreMissingSiteUrl )
-        throws MojoFailureException
-    {
-        if ( project.getDistributionManagement() == null )
+        else
         {
-            String hierarchy = project.getArtifactId();
-
-            MavenProject parent = project.getParent();
-            while ( parent != null )
-            {
-                hierarchy = parent.getArtifactId() + "/" + hierarchy;
-                parent = parent.getParent();
-            }
-
-            return hierarchy;
+            getLog().debug( "stagingDirectory NOT specified by the user." );
         }
 
-        Site site = project.getDistributionManagement().getSite();
-        if ( site == null )
-        {
-            if ( !ignoreMissingSiteUrl )
-            {
-                throw new MojoFailureException(
-                    "Missing site information in the distribution management element in the project: '"
-                    + project.getName() + "'." );
-            }
-
-            return null;
-        }
+        MavenProject parentProject = getTopLevelParent( currentProject );
 
-        if ( StringUtils.isEmpty( site.getUrl() ) )
+        // Take the distributionManagement site url from the top level project,
+        // if there is one, otherwise take it from the current project
+        if ( parentProject == null )
         {
-            if ( !ignoreMissingSiteUrl )
+            if ( topLevelURL == null )
             {
-                throw new MojoFailureException( "The URL in the site is missing in the project descriptor." );
+                // The user didn't specify a URL and there is no top level project in the reactor
+                // Use current project
+                topLevelURL =
+                    getTopLevelBuildDirectory().getAbsolutePath() + "/" + DEFAULT_STAGING_DIRECTORY;
+                getLog().debug( "No top level project found in the reactor, using the current project: " + topLevelURL );
             }
-
-            return null;
         }
-
-        Repository repository = new Repository( site.getId(), site.getUrl() );
-        StringBuffer hierarchy = new StringBuffer( 1024 );
-        hierarchy.append( repository.getHost() );
-        if ( !StringUtils.isEmpty( repository.getBasedir() ) )
+        else
         {
-            if ( !repository.getBasedir().startsWith( "/" ) )
+            // Find the relative path between the parent and child distribution URLs, if any
+            relative = "/" + siteTool.getRelativePath( currentProject.getDistributionManagement().getSite().getUrl(),
+                                                       parentProject.getDistributionManagement().getSite().getUrl() );
+            // SiteTool.getRelativePath() uses File.separatorChar, so we need to convert '\' to '/' in order for the URL
+            // to be valid for Windows users
+            relative = relative.replace( '\\', '/' );
+
+            if ( topLevelURL == null )
             {
-                hierarchy.append( '/' );
+                // The user didn't specify a URL and there is a top level project in the reactor
+                // Use the top level project
+                topLevelURL =
+                    getTopLevelBuildDirectory().getAbsolutePath() + "/" + DEFAULT_STAGING_DIRECTORY;
+                getLog().debug( "Using the top level project: " + topLevelURL );
             }
-            hierarchy.append( repository.getBasedir() );
         }
 
-        return hierarchy.toString().replaceAll( "[\\:\\?\\*]", "" );
+        // Return either
+        //   usersURL + relative(from parent, to child)
+        // or
+        //   topLevelProjectURL + staging + relative(from parent, to child)
+        return topLevelURL + relative;
     }
 }