Author: hboutemy
Date: Fri Dec 18 23:20:36 2015
New Revision: 1720857

URL: http://svn.apache.org/viewvc?rev=1720857&view=rev
Log:
[MSITE-744] copy generated resources even if there is no generated Doxia 
document

Added:
    maven/plugins/trunk/maven-site-plugin/src/it/resources/
    maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties   
(with props)
    maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml   (with 
props)
    maven/plugins/trunk/maven-site-plugin/src/it/resources/src/
    maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/
    maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/
    
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
   (with props)
    maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy   
(with props)
Modified:
    
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
    
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/ReportDocumentRenderer.java
    
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
    
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java

Added: maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties?rev=1720857&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties 
(added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties 
Fri Dec 18 23:20:36 2015
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = site
\ No newline at end of file

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/invoker.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml?rev=1720857&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml Fri Dec 18 
23:20:36 2015
@@ -0,0 +1,74 @@
+<?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>
+
+  <groupId>org.apache.maven.plugins.site.its</groupId>
+  <artifactId>resources</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>MSITE-744 Resources copy, even if no Doxia document</name>
+  <description>
+    Resources come from skin, src/site/resources and 
target/generated-site/resources
+  </description>
+  <url>https://issues.apache.org/jira/browse/MSITE-744</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <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>
+    <plugins>
+      <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+          <version>1.7</version>
+          <executions>
+            <execution>
+              <phase>pre-site</phase>
+              <goals>
+                <goal>run</goal>
+              </goals>
+              <configuration>
+                <target>
+                    <copy file="src/site/resources/src-site-resources.txt"
+                          
tofile="${project.build.directory}/generated-site/resources/generated-site-resources.txt"/>
+                </target>
+              </configuration>
+            </execution>
+          </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-site-plugin/src/it/resources/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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

Added: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt?rev=1720857&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
 (added)
+++ 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
 Fri Dec 18 23:20:36 2015
@@ -0,0 +1,16 @@
+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.

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: 
maven/plugins/trunk/maven-site-plugin/src/it/resources/src/site/resources/src-site-resources.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy?rev=1720857&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy Fri 
Dec 18 23:20:36 2015
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+File site = new File( basedir, 'target/site' )
+assert site.exists();
+
+// file from src/site/resources
+assert new File( site, 'src-site-resources.txt' ).exists();
+// file from target/generated-site/resources
+assert new File( site, 'generated-site-resources.txt' ).exists();
+// file from maven-default-skin:jar:1.0
+assert new File( site, 'images/logos/maven-feather.png' ).exists();
+
+return true;
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-site-plugin/src/it/resources/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java?rev=1720857&r1=1720856&r2=1720857&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
 Fri Dec 18 23:20:36 2015
@@ -433,10 +433,11 @@ public abstract class AbstractSiteRender
 
     /**
      * Locate every document to be rendered for given locale:<ul>
-     * <li>handwritten content,</li>
+     * <li>handwritten content, ie Doxia files,</li>
      * <li>reports,</li>
      * <li>"Project Information" and "Project Reports" category summaries.</li>
      * </ul>
+     * @see CategorySummaryDocumentRenderer
      */
     protected Map<String, DocumentRenderer> locateDocuments( 
SiteRenderingContext context,
                                                              
List<MavenReportExecution> reports, Locale locale )

Modified: 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/ReportDocumentRenderer.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/ReportDocumentRenderer.java?rev=1720857&r1=1720856&r2=1720857&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/ReportDocumentRenderer.java
 (original)
+++ 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/ReportDocumentRenderer.java
 Fri Dec 18 23:20:36 2015
@@ -49,7 +49,7 @@ import org.codehaus.plexus.util.StringUt
 import org.codehaus.plexus.util.WriterFactory;
 
 /**
- * Renders a Maven report in a doxia site.
+ * Renders a Maven report in a Doxia site.
  *
  * @author <a href="mailto:[email protected]";>Brett Porter</a>
  */

Modified: 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java?rev=1720857&r1=1720856&r2=1720857&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
 Fri Dec 18 23:20:36 2015
@@ -168,11 +168,14 @@ public class SiteMojo
 
         Map<String, DocumentRenderer> documents = locateDocuments( context, 
reports, locale );
 
+        // copy resources
+        siteRenderer.copyResources( context, outputDir );
+
         // 1. render Doxia documents first
         List<DocumentRenderer> reportDocuments = renderDoxiaDocuments( 
documents, context, outputDir, false );
 
         // 2. then reports
-        // For external reports
+        // prepare external reports
         for ( MavenReportExecution mavenReportExecution : reports )
         {
             MavenReport report = mavenReportExecution.getMavenReport();
@@ -196,12 +199,15 @@ public class SiteMojo
         Map<String, DocumentRenderer> generatedDocuments = 
siteRenderer.locateDocumentFiles( context );
 
         renderDoxiaDocuments( generatedDocuments, context, outputDir, true );
+
+        // copy generated resources also
+        siteRenderer.copyResources( context, outputDir );
     }
 
     /**
-     * Renders Doxia documents, but not reports.
-     * @param documents a collection of documents
-     * @return the sublist of documents that are not Doxia parsed
+     * Render Doxia documents from the list given, but not reports.
+     * @param documents a collection of documents containing both Doxia source 
files and reports
+     * @return the sublist of documents that are not Doxia source files
      */
     private List<DocumentRenderer> renderDoxiaDocuments( Map<String, 
DocumentRenderer> documents,
                                                          SiteRenderingContext 
context, File outputDir,

Modified: 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java?rev=1720857&r1=1720856&r2=1720857&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
 Fri Dec 18 23:20:36 2015
@@ -195,13 +195,11 @@ public class SiteRunMojo
 
                 if ( defaultLocale.equals( locale ) )
                 {
-                    siteRenderer.copyResources( i18nContext, new File( 
siteDirectory, "resources" ),
-                                                tempWebappDirectory );
+                    siteRenderer.copyResources( i18nContext, 
tempWebappDirectory );
                 }
                 else
                 {
-                    siteRenderer.copyResources( i18nContext, new File( 
siteDirectory, "resources" ),
-                                                new File( tempWebappDirectory, 
locale.getLanguage() ) );
+                    siteRenderer.copyResources( i18nContext, new File( 
tempWebappDirectory, locale.getLanguage() ) );
                 }
             }
 


Reply via email to