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 2018/01/03 17:41:26 UTC

[maven-site-plugin] 13/30: [MSITE-600] merge revs 1174605, 1174614 from trunk

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-site-plugin-2.4
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git

commit e467fed9a1302217155d920b4ed3d484acc6d6a2
Author: Lukas Theussl <lt...@apache.org>
AuthorDate: Tue Sep 27 06:55:26 2011 +0000

    [MSITE-600] merge revs 1174605,1174614 from trunk
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/branches/maven-site-plugin-2.x@1176233 13f79535-47bb-0310-9956-ffa450edef68
---
 .../top-parent-different-site/invoker.properties   |  2 +
 src/it/top-parent-different-site/module1/pom.xml   | 16 +++++
 src/it/top-parent-different-site/pom.xml           | 31 +++++++++
 src/it/top-parent-different-site/root/pom.xml      | 33 ++++++++++
 src/it/top-parent-different-site/verify.bsh        | 75 ++++++++++++++++++++++
 .../maven/plugins/site/AbstractDeployMojo.java     | 12 ++++
 6 files changed, 169 insertions(+)

diff --git a/src/it/top-parent-different-site/invoker.properties b/src/it/top-parent-different-site/invoker.properties
new file mode 100644
index 0000000..ea32a8f
--- /dev/null
+++ b/src/it/top-parent-different-site/invoker.properties
@@ -0,0 +1,2 @@
+invoker.goals.1 = clean
+invoker.goals.2 = site:site site:deploy site:stage site:stage-deploy
diff --git a/src/it/top-parent-different-site/module1/pom.xml b/src/it/top-parent-different-site/module1/pom.xml
new file mode 100644
index 0000000..bd05648
--- /dev/null
+++ b/src/it/top-parent-different-site/module1/pom.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
+    <artifactId>main</artifactId>
+    <version>1.0-SNAPSHOT</version>
+	<relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>module1</artifactId>
+
+  <name>module 1</name>
+
+</project>
diff --git a/src/it/top-parent-different-site/pom.xml b/src/it/top-parent-different-site/pom.xml
new file mode 100644
index 0000000..fd542f5
--- /dev/null
+++ b/src/it/top-parent-different-site/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
+    <artifactId>root</artifactId>
+    <version>1.0-SNAPSHOT</version>
+	<relativePath>root/pom.xml</relativePath>
+  </parent>
+
+  <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
+  <artifactId>main</artifactId>
+  <packaging>pom</packaging>
+  <name>main</name>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>http://dummy.com/</url>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>file://@project.build.directory@/it/top-parent-different-site/deploy/</url>
+    </site>
+  </distributionManagement>
+
+  <modules>
+    <module>module1</module>
+  </modules>
+
+</project>
diff --git a/src/it/top-parent-different-site/root/pom.xml b/src/it/top-parent-different-site/root/pom.xml
new file mode 100644
index 0000000..92f2255
--- /dev/null
+++ b/src/it/top-parent-different-site/root/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.its.differentparentsite</groupId>
+  <artifactId>root</artifactId>
+  <packaging>pom</packaging>
+  <name>root</name>
+  <version>1.0-SNAPSHOT</version>
+
+  <distributionManagement>
+    <site>
+      <id>website</id>
+      <url>scp://dummy.org/top-parent-different-site/deploy/root/</url>
+    </site>
+  </distributionManagement>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <generateReports>false</generateReports>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/top-parent-different-site/verify.bsh b/src/it/top-parent-different-site/verify.bsh
new file mode 100644
index 0000000..1ea20e9
--- /dev/null
+++ b/src/it/top-parent-different-site/verify.bsh
@@ -0,0 +1,75 @@
+
+/*
+ * 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.*;
+
+boolean result = true;
+
+try
+{
+    File deployDirectory = new File( basedir, "deploy" );
+    if ( !deployDirectory.exists() || !deployDirectory.isDirectory() )
+    {
+        System.err.println( "deploy directory is missing or not a directory:" );
+        return false;
+    }
+
+    File deployModuleDirectory = new File( deployDirectory, "module1" );
+    if ( !deployModuleDirectory.exists() || !deployModuleDirectory.isDirectory() )
+    {
+        System.err.println( "deploy module directory is missing or not a directory:" );
+        return false;
+    }
+
+    File stageDeployDirectory = new File( deployDirectory, "staging" );
+    if ( !stageDeployDirectory.exists() || !stageDeployDirectory.isDirectory() )
+    {
+        System.err.println( "stageDeployDirectory file is missing or not a directory." );
+        return false;
+    }
+
+    File stageDeployModuleDirectory = new File( stageDeployDirectory, "module1" );
+    if ( !stageDeployModuleDirectory.exists() || !stageDeployModuleDirectory.isDirectory() )
+    {
+        System.err.println( "stageDeployModuleDirectory file is missing or not a directory." );
+        return false;
+    }
+
+    File stageDirectory = new File( basedir, "target/staging" );
+    if ( !stageDirectory.exists() || !stageDirectory.isDirectory() )
+    {
+        System.err.println( "stageDirectory file is missing or not a directory." );
+        return false;
+    }
+
+    File stageModuleDirectory = new File( stageDirectory, "module1" );
+    if ( !stageModuleDirectory.exists() || !stageModuleDirectory.isDirectory() )
+    {
+        System.err.println( "stageModuleDirectory file is missing or not a directory." );
+        return false;
+    }
+}
+catch ( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;
diff --git a/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java b/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
index 9e5e435..af62eaa 100644
--- a/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/site/AbstractDeployMojo.java
@@ -26,6 +26,7 @@ import java.util.Locale;
 
 import org.apache.maven.artifact.manager.WagonConfigurationException;
 import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.doxia.site.decoration.inheritance.URIPathDescriptor;
 import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.model.Site;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -664,6 +665,8 @@ public abstract class AbstractDeployMojo
             // MSITE-585, MNG-1943
             parent = siteTool.getParentProject( parent, reactorProjects, localRepository );
 
+            Site oldSite = site;
+
             try
             {
                 site = getSite( parent );
@@ -672,6 +675,15 @@ public abstract class AbstractDeployMojo
             {
                 break;
             }
+
+            // MSITE-600
+            URIPathDescriptor siteURI = new URIPathDescriptor( site.getUrl(), "" );
+            URIPathDescriptor oldSiteURI = new URIPathDescriptor( oldSite.getUrl(), "" );
+
+            if ( !siteURI.sameSite( oldSiteURI.getBaseURI() ) )
+            {
+                return oldSite;
+            }
         }
 
         return site;

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.