Author: michaelo
Date: Thu Nov 27 10:46:33 2014
New Revision: 1642084

URL: http://svn.apache.org/r1642084
Log:
[MPIR-263] Add parameter 'targetJavaVersion' and inject ${maven.compiler.target}

Modified:
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_cs.properties
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_de.properties
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_pt_BR.properties
    
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_sv.properties

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoReport.java
 Thu Nov 27 10:46:33 2014
@@ -177,6 +177,15 @@ public abstract class AbstractProjectInf
     @Parameter( property = "mpir.skip", defaultValue = "false" )
     private boolean skip;
 
+    /**
+     * The target Java version the artifact is built for. Should match the 
target used in the
+     * compiler plugin.
+     *
+     * @since 2.8
+     */
+    @Parameter( property = "mpir.targetJavaVersion", defaultValue = 
"${maven.compiler.target}" )
+    protected String targetJavaVersion;
+
     // ----------------------------------------------------------------------
     // Public methods
     // ----------------------------------------------------------------------
@@ -271,7 +280,7 @@ public abstract class AbstractProjectInf
 
     /**
      * @param coll The collection to be checked.
-     * @return true if coll is empty false otherwise. 
+     * @return true if coll is empty false otherwise.
      */
     protected boolean isEmpty( Collection<?> coll )
     {

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ProjectSummaryReport.java
 Thu Nov 27 10:46:33 2014
@@ -130,7 +130,7 @@ public class ProjectSummaryReport
             tableRow( new String[] { getI18nString( "build.type" ), 
project.getPackaging() } );
             if ( isJavaProject( project ) )
             {
-                tableRow( new String[] { getI18nString( "build.jdk" ), 
getMinimumJavaVersion() } );
+                tableRow( new String[] { getI18nString( "build.javaVersion" ), 
targetJavaVersion } );
             }
             endTable();
             endSection();
@@ -150,38 +150,6 @@ public class ProjectSummaryReport
             endSection();
         }
 
-        private String getMinimumJavaVersion()
-        {
-            
-            final String pluginId = 
"org.apache.maven.plugins:maven-compiler-plugin";
-            String sourceConfigured = getPluginParameter( pluginId, "source" );
-            String targetConfigured = getPluginParameter( pluginId, "target" );
-            
-            String forkFlag = getPluginParameter( pluginId, "fork" );
-            String compilerVersionConfigured = null;
-                if ( "true".equalsIgnoreCase( forkFlag ) )
-                {
-                    compilerVersionConfigured = getPluginParameter( pluginId, 
"compilerVersion" );
-                }
-
-            String minimumJavaVersion = compilerVersionConfigured;
-            if ( targetConfigured != null )
-            {
-                minimumJavaVersion = targetConfigured;
-            }
-            else if ( sourceConfigured != null )
-            {
-                minimumJavaVersion = sourceConfigured;
-            }
-            else
-            {
-                // no source, target, compilerVersion: toolchain? default 
target attribute of current
-                // maven-compiler-plugin's version? analyze packaged jar (like 
dependencies)?
-            }
-
-            return minimumJavaVersion;
-        }
-
         private void tableRowWithLink( String[] content )
         {
             sink.tableRow();

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report.properties
 Thu Nov 27 10:46:33 2014
@@ -198,7 +198,7 @@ report.scm.webaccess.title              
 report.scm.webaccess.url                                           = The 
following is a link to the online source repository:
 report.summary.build.artifactid                                    = ArtifactId
 report.summary.build.groupid                                       = GroupId
-report.summary.build.jdk                                           = JDK Rev
+report.summary.build.javaVersion                                   = Java 
Version
 report.summary.build.title                                         = Build 
Information
 report.summary.build.type                                          = Type
 report.summary.build.version                                       = Version

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_cs.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_cs.properties?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_cs.properties
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_cs.properties
 Thu Nov 27 10:46:33 2014
@@ -192,7 +192,6 @@ report.scm.webaccess.title              
 report.scm.webaccess.url                                           = Odkaz na 
webov\u00e9 rozhran\u00ed repozit\u00e1\u0159e.
 report.summary.build.artifactid                                    = Id 
artefaktu
 report.summary.build.groupid                                       = Id skupiny
-report.summary.build.jdk                                           = JDK Rev
 report.summary.build.title                                         = 
Sestaven\u00ed
 report.summary.build.type                                          = Typ
 report.summary.build.version                                       = Verze

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_de.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_de.properties?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_de.properties
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_de.properties
 Thu Nov 27 10:46:33 2014
@@ -194,7 +194,7 @@ report.scm.webaccess.title              
 report.scm.webaccess.url                                           = Es folgt 
ein Verweis auf das Web-Portal des Quellcode-Archivs dieses Projektes.
 report.summary.build.artifactid                                    = ArtifactId
 report.summary.build.groupid                                       = GroupId
-report.summary.build.jdk                                           = JDK Rev
+report.summary.build.javaVersion                                   = 
Java-Version
 report.summary.build.title                                         = 
Build-Information
 report.summary.build.type                                          = Typ
 report.summary.build.version                                       = Version

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_pt_BR.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_pt_BR.properties?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_pt_BR.properties
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_pt_BR.properties
 Thu Nov 27 10:46:33 2014
@@ -230,7 +230,6 @@ report.scm.webaccess.title              
 report.scm.webaccess.url                                           = Abaixo 
\u00e9 o endere\u00e7o para acesso ao reposit\u00f3rio
 report.summary.build.artifactid                                    = ArtifactId
 report.summary.build.groupid                                       = GroupId
-report.summary.build.jdk                                           = JDK Rev
 report.summary.build.title                                         = 
Informa\u00e7\u00f5es de Build
 report.summary.build.type                                          = Tipo
 report.summary.build.version                                       = 
Vers\u00e3o

Modified: 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_sv.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_sv.properties?rev=1642084&r1=1642083&r2=1642084&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_sv.properties
 (original)
+++ 
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/resources/project-info-report_sv.properties
 Thu Nov 27 10:46:33 2014
@@ -186,7 +186,6 @@ report.scm.webaccess.title              
 report.scm.webaccess.url                                           = 
F\u00f6ljande \u00e4r en l\u00e4nk f\u00f6r webb\u00e5tkomst till 
versionshanteringssystemet.
 report.summary.build.artifactid                                    = ArtifactId
 report.summary.build.groupid                                       = GroupId
-report.summary.build.jdk                                           = JDK rev
 report.summary.build.title                                         = 
Bygginformation
 report.summary.build.type                                          = Typ
 report.summary.build.version                                       = Version


Reply via email to