maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1233991 - in /maven/plugins/trunk/maven-jar-plugin: pom.xml src/it/manifest-content/verify.bsh src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
Date Fri, 20 Jan 2012 16:29:26 GMT
Author: olamy
Date: Fri Jan 20 16:29:25 2012
New Revision: 1233991

URL: http://svn.apache.org/viewvc?rev=1233991&view=rev
Log:
[MJAR-148] Add Maven version used to Created-By entry in manifest
Submitted by Anders Hammar.

Modified:
    maven/plugins/trunk/maven-jar-plugin/pom.xml
    maven/plugins/trunk/maven-jar-plugin/src/it/manifest-content/verify.bsh
    maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java

Modified: maven/plugins/trunk/maven-jar-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/pom.xml?rev=1233991&r1=1233990&r2=1233991&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-jar-plugin/pom.xml Fri Jan 20 16:29:25 2012
@@ -64,7 +64,7 @@ under the License.
   </issueManagement>
 
   <properties>
-    <mavenArchiverVersion>2.4.1</mavenArchiverVersion>
+    <mavenArchiverVersion>2.5-SNAPSHOT</mavenArchiverVersion>
     <mavenVersion>2.0.6</mavenVersion>
   </properties>
 

Modified: maven/plugins/trunk/maven-jar-plugin/src/it/manifest-content/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/manifest-content/verify.bsh?rev=1233991&r1=1233990&r2=1233991&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/manifest-content/verify.bsh (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/manifest-content/verify.bsh Fri Jan 20 16:29:25
2012
@@ -45,7 +45,7 @@ try
 
     Attributes manifest = jar.getManifest().getMainAttributes();
 
-    if ( !"Apache Maven".equals( manifest.get( new Attributes.Name( "Created-By" ) ) ) )
+    if ( !manifest.getValue( new Attributes.Name( "Created-By" ) ).startsWith( "Apache Maven"
) )
     {
         System.err.println( "Created-By not equals Apache Maven" );
         return false;

Modified: maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=1233991&r1=1233990&r2=1233991&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
(original)
+++ maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
Fri Jan 20 16:29:25 2012
@@ -21,6 +21,7 @@ package org.apache.maven.plugin.jar;
 
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
@@ -92,6 +93,13 @@ public abstract class AbstractJarMojo
     private MavenProject project;
 
     /**
+     * @parameter default-value="${session}"
+     * @readonly
+     * @required
+     */
+    private MavenSession session;
+
+    /**
      * The archive configuration to use.
      * See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven
Archiver Reference</a>.
      *
@@ -213,7 +221,7 @@ public abstract class AbstractJarMojo
                 archive.setManifestFile( existingManifest );
             }
 
-            archiver.createArchive( project, archive );
+            archiver.createArchive( session, project, archive );
 
             return jarFile;
         }



Mime
View raw message