[MPOM-96] added mono-module profile

git-svn-id: https://svn.apache.org/repos/asf/maven/pom/trunk@1716984 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/maven/doxia-tools/pom.xml b/maven/doxia-tools/pom.xml
index ee55562..85519c2 100644
--- a/maven/doxia-tools/pom.xml
+++ b/maven/doxia-tools/pom.xml
@@ -63,6 +63,7 @@
   <properties>
     <projectVersion>${project.version}</projectVersion>
     <maven.site.path>doxia-tools-archives/${project.artifactId}-LATEST</maven.site.path>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
   </properties>
 
   <dependencyManagement>
@@ -105,13 +106,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-scm-publish-plugin</artifactId>
-        <configuration>
-          <content>${project.reporting.outputDirectory}</content><!-- doxia-tools are mono-module, no real need for site:stage -->
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/maven/maven-archetype-bundles/pom.xml b/maven/maven-archetype-bundles/pom.xml
index 4990ab2..be06691 100644
--- a/maven/maven-archetype-bundles/pom.xml
+++ b/maven/maven-archetype-bundles/pom.xml
@@ -47,6 +47,11 @@
     <url>https://issues.apache.org/jira/browse/MARCHETYPES</url>
   </issueManagement>
 
+  <properties>
+    <maven.site.path>archetypes-archives/${project.artifactId}-LATEST</maven.site.path>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
+  </properties>
+
   <build>
     <extensions>
       <extension>
diff --git a/maven/maven-plugins/pom.xml b/maven/maven-plugins/pom.xml
index 772c202..f925f36 100644
--- a/maven/maven-plugins/pom.xml
+++ b/maven/maven-plugins/pom.xml
@@ -55,6 +55,7 @@
 
   <properties>
     <maven.site.path>plugins-archives/${project.artifactId}-LATEST</maven.site.path>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
     <mavenInvokerPluginVersion>2.0.0</mavenInvokerPluginVersion>
   </properties>
 
@@ -153,13 +154,6 @@
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-scm-publish-plugin</artifactId>
-        <configuration>
-          <content>${project.reporting.outputDirectory}</content><!-- plugins are mono-module, no real need for site:stage -->
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
         <executions>
           <execution>
diff --git a/maven/maven-shared-components/pom.xml b/maven/maven-shared-components/pom.xml
index 0e712a9..a328ab6 100644
--- a/maven/maven-shared-components/pom.xml
+++ b/maven/maven-shared-components/pom.xml
@@ -59,6 +59,7 @@
 
   <properties>
     <maven.site.path>shared-archives/${project.artifactId}-LATEST</maven.site.path>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
   </properties>
 
   <repositories>
@@ -118,14 +119,5 @@
         </plugin>
       </plugins>
     </pluginManagement>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-scm-publish-plugin</artifactId>
-        <configuration>
-          <content>${project.reporting.outputDirectory}</content>
-        </configuration>
-      </plugin>
-    </plugins>
   </build>
 </project>
diff --git a/maven/maven-skins/pom.xml b/maven/maven-skins/pom.xml
index edce6ea..383f017 100644
--- a/maven/maven-skins/pom.xml
+++ b/maven/maven-skins/pom.xml
@@ -60,6 +60,7 @@
 
   <properties>
     <maven.site.path>skins-archives/${project.artifactId}-LATEST</maven.site.path>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
     <sitePluginVersion>3.3</sitePluginVersion>
   </properties>
 
@@ -75,14 +76,5 @@
         </plugin>
       </plugins>
     </pluginManagement>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-scm-publish-plugin</artifactId>
-        <configuration>
-          <content>${project.reporting.outputDirectory}</content><!-- skins are mono-module, no real need for site:stage -->
-        </configuration>
-      </plugin>
-    </plugins>
   </build>
 </project>
diff --git a/maven/pom.xml b/maven/pom.xml
index 6908e35..f141ed7 100644
--- a/maven/pom.xml
+++ b/maven/pom.xml
@@ -1299,5 +1299,38 @@
         </plugins>
       </reporting>
     </profile>
+    <profile>
+      <id>site.scm-deploy</id>
+      <activation>
+        <property><name>maven.site.scm-deploy</name><value>deploy</value></property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-site-plugin</artifactId>
+            <configuration>
+              <skipDeploy>true</skipDeploy><!-- don't deploy site with maven-site-plugin -->
+            </configuration>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-scm-publish-plugin</artifactId>
+            <configuration>
+              <content>${project.reporting.outputDirectory}</content><!-- no need for site:stage, use target/site -->
+            </configuration>
+            <executions>
+              <execution>
+                <id>scm-publish</id>
+                <phase>site-deploy</phase><!-- deploy site with maven-scm-publish-plugin -->
+                <goals>
+                  <goal>publish-scm</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 </project>
diff --git a/maven/src/site-docs/apt/index.apt.vm b/maven/src/site-docs/apt/index.apt.vm
index d787dab..f5f4186 100644
--- a/maven/src/site-docs/apt/index.apt.vm
+++ b/maven/src/site-docs/apt/index.apt.vm
@@ -65,7 +65,7 @@
 
 +-----+
   <properties>
-    <maven.site.path>xxx-archives/artifactId-LATEST</maven.site.path>
+    <maven.site.path>xxx-archives/\${project.artifactId}-LATEST</maven.site.path>
   </properties>
   <distributionManagement>
     <site>
@@ -85,6 +85,23 @@
     See {{{/developers/website/deploy-component-reference-documentation.html}deploying Maven components reference documentation}}
     for more information.
 
+* Mono Module: <<<site.scm-deploy>>> profile
+
+    If the build is mono module, previous 2-steps publication can be simplified by activating <<<site.scm-deploy>>> profile
+    through <<<maven.site.scm-deploy>>> property
+
++-----+
+  <properties>
+    <maven.site.scm-deploy>true</maven.site.scm-deploy>
+  </properties>
++-----+
+
+    Once this is configured, the site can be published in only command:
+
++-----+
+mvn -Preporting site-deploy
++-----+
+
 History
 
 #if( $project.version.endsWith( "SNAPSHOT" ) )