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 2016/05/15 07:08:58 UTC

svn commit: r1743884 - in /maven/plugins/trunk/maven-site-plugin/src: it/site-attach-descriptor/ it/site-attach-descriptor/child/ it/site-attach-descriptor/no-descriptor/ main/java/org/apache/maven/plugins/site/descriptor/

Author: hboutemy
Date: Sun May 15 07:08:58 2016
New Revision: 1743884

URL: http://svn.apache.org/viewvc?rev=1743884&view=rev
Log:
[MSITE-775] also add an info mesage when no site descriptor found

Added:
    maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/
    maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml   (with props)
Modified:
    maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/child/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/child/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/child/pom.xml?rev=1743884&r1=1743883&r2=1743884&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/child/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/child/pom.xml Sun May 15 07:08:58 2016
@@ -34,5 +34,5 @@ under the License.
   <packaging>jar</packaging>
 
   <name>site-attach-descriptor IT for jar</name>
-  <description>the site descriptor should not be attached: only when packaging = pom, see http://jira.codehaus.org/browse/MSITE-597</description>
+  <description>the site descriptor should not be attached: only when packaging = pom, see https://issues.apache.org/jira/browse/MSITE-597</description>
 </project>

Added: maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml?rev=1743884&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml Sun May 15 07:08:58 2016
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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>org.apache.maven.plugins.site.its</groupId>
+    <artifactId>site-attach-descriptor</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>no-descriptor-attach-descriptor</artifactId>
+  <packaging>pom</packaging>
+
+  <name>site-attach-descriptor IT for jar</name>
+  <description>No site descriptor to attach: must not fail, just explain.</description>
+</project>

Propchange: maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/no-descriptor/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/pom.xml?rev=1743884&r1=1743883&r2=1743884&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/src/it/site-attach-descriptor/pom.xml Sun May 15 07:08:58 2016
@@ -33,6 +33,7 @@ under the License.
 
   <modules>
     <module>child</module>
+    <module>no-descriptor</module>
   </modules>
 
   <properties>
@@ -69,6 +70,14 @@ under the License.
         <configuration>
           <locales>en,sv</locales>
         </configuration>
+        <executions>
+          <execution>
+            <id>attach-descriptor</id>
+            <goals>
+              <goal>attach-descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
   </build>
@@ -89,31 +98,4 @@ under the License.
       </plugin>
     </plugins>
   </reporting>
-
-  <profiles>
-    <profile>
-      <id>maven-3</id>
-      <activation>
-        <file>
-          <!--  This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
-          <exists>${basedir}</exists>
-        </file>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-site-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-descriptor</id>
-                <goals>
-                  <goal>attach-descriptor</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
 </project>

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java?rev=1743884&r1=1743883&r2=1743884&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java Sun May 15 07:08:58 2016
@@ -79,12 +79,15 @@ public class SiteDescriptorAttachMojo
             return;
         }
 
+        boolean attachedSiteDescriptor = false;
         for ( Locale locale : getLocales() )
         {
             File descriptorFile = siteTool.getSiteDescriptor( siteDirectory, locale );
 
             if ( descriptorFile.exists() )
             {
+                attachedSiteDescriptor = true;
+
                 // Calculate the classifier to use
                 String classifier = getClassifier( descriptorFile );
                 // Prepare a file for the interpolated site descriptor
@@ -107,6 +110,11 @@ public class SiteDescriptorAttachMojo
                 }
             }
         }
+
+        if ( !attachedSiteDescriptor )
+        {
+            getLog().info( "No site descriptor found: nothing to attach." );
+        }
     }
 
     private static String getClassifier( final File descriptorFile )