You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/07/07 13:28:31 UTC

[maven-site-plugin] branch MSITE-844 created (now 2282f98)

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

michaelo pushed a change to branch MSITE-844
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git.


      at 2282f98  [MSITE-844] Downgrade to Java 7

This branch includes the following new commits:

     new 2282f98  [MSITE-844] Downgrade to Java 7

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-site-plugin] 01/01: [MSITE-844] Downgrade to Java 7

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MSITE-844
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git

commit 2282f98e88730bcb7e5c6e65756b3b29065c374a
Author: tibordigana <ti...@apache.org>
AuthorDate: Fri Jul 5 12:47:53 2019 +0200

    [MSITE-844] Downgrade to Java 7
    
    This closes #10
---
 Jenkinsfile                                        |  2 +-
 pom.xml                                            |  2 +-
 .../maven/plugins/site/deploy/SiteStageMojo.java   | 14 +++++++----
 .../site/render/AbstractSiteRenderingMojo.java     | 28 ++++++++++++----------
 4 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 81caf8c..5a994fd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-asfMavenTlpPlgnBuild(jdk:['8','11','12'], maven:['3.0.x', '3.2.x', '3.3.x', '3.5.x'])
+asfMavenTlpPlgnBuild(jdk:['7','8','11','12'], maven:['3.0.x', '3.2.x', '3.3.x', '3.5.x'])
diff --git a/pom.xml b/pom.xml
index 12abee8..f021213 100644
--- a/pom.xml
+++ b/pom.xml
@@ -196,7 +196,7 @@ under the License.
 
   <properties>
     <mavenVersion>3.0</mavenVersion>
-    <javaVersion>8</javaVersion>
+    <javaVersion>7</javaVersion>
     <!-- for dependencies -->
     <doxiaVersion>1.9</doxiaVersion>
     <doxiaSitetoolsVersion>1.9.1</doxiaSitetoolsVersion>
diff --git a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
index c3d10ab..a9b8848 100644
--- a/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
+++ b/src/main/java/org/apache/maven/plugins/site/deploy/SiteStageMojo.java
@@ -164,10 +164,14 @@ public class SiteStageMojo
             return null;
         }
 
-        return reactorProjects //
-            .stream() //
-            .filter( mavenProject -> mavenProject.isExecutionRoot() ) //
-            .findFirst().get();
-
+        // todo Lambda Java 1.8
+        for ( MavenProject reactorProject : reactorProjects )
+        {
+            if ( reactorProject.isExecutionRoot() )
+            {
+                return reactorProject;
+            }
+        }
+        return null;
     }
 }
diff --git a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
index 0d89700..7336d0f 100644
--- a/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
+++ b/src/main/java/org/apache/maven/plugins/site/render/AbstractSiteRenderingMojo.java
@@ -61,7 +61,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
 
@@ -231,8 +230,7 @@ public abstract class AbstractSiteRenderingMojo
     protected List<MavenReportExecution> getReports()
         throws MojoExecutionException
     {
-        List<MavenReportExecution> allReports;
-
+        final List<MavenReportExecution> allReports;
         if ( isMaven3OrMore() )
         {
             // Maven 3
@@ -257,18 +255,24 @@ public abstract class AbstractSiteRenderingMojo
         else
         {
             // Maven 2
-            // [olamy] do we still need Maven2 support??
-            allReports = reports.stream()
-                .map( report -> new MavenReportExecution( report ) )
-                .collect( Collectors.toList() );
+            allReports = new ArrayList<>( reports.size() );
+            for ( MavenReport report : reports )
+            {
+                allReports.add( new MavenReportExecution( report ) );
+            }
         }
 
         // filter out reports that can't be generated
-
-        return allReports.stream() //
-            .filter( mavenReportExecution -> mavenReportExecution.canGenerateReport() ) //
-            .collect( Collectors.toList() );
-
+        // todo Lambda Java 1.8
+        List<MavenReportExecution> reportExecutions = new ArrayList<>( allReports.size() );
+        for ( MavenReportExecution exec : allReports )
+        {
+            if ( exec.canGenerateReport() )
+            {
+                reportExecutions.add( exec );
+            }
+        }
+        return reportExecutions;
     }
 
     /**