You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2012/01/25 21:49:51 UTC

svn commit: r1235935 - /maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh

Author: dennisl
Date: Wed Jan 25 20:49:51 2012
New Revision: 1235935

URL: http://svn.apache.org/viewvc?rev=1235935&view=rev
Log:
[MEJB-56] Add Maven version used to Created-By entry in manifest
Submitted by: Anders Hammar
Reviewed by: Dennis Lundberg

- Add more checks to the IT

Modified:
    maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh

Modified: maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh?rev=1235935&r1=1235934&r2=1235935&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh (original)
+++ maven/plugins/trunk/maven-ejb-plugin/src/it/manifest-content/verify.bsh Wed Jan 25 20:49:51 2012
@@ -12,8 +12,14 @@ if ( !jarFile.isFile() )
 
 JarFile jar = new JarFile( jarFile );
 
-Manifest mf = jar.getManifest();
-String classpath = mf.getMainAttributes().getValue( Attributes.Name.CLASS_PATH );
+Attributes manifest = jar.getManifest().getMainAttributes();
+
+if ( !manifest.getValue( new Attributes.Name( "Created-By" ) ).startsWith( "Apache Maven" ) )
+{
+    throw new IllegalStateException( "Created-By not equals Apache Maven" );
+}
+
+String classpath = manifest.getValue( Attributes.Name.CLASS_PATH );
 if ( classpath == null || classpath.indexOf( "junit-3.8.2.jar" ) < 0 )
 {
     throw new IllegalStateException( "Bad Class-Path " + classpath );