activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419267 - /incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java
Date Wed, 05 Jul 2006 16:05:04 GMT
Author: chirino
Date: Wed Jul  5 09:05:04 2006
New Revision: 419267

URL: http://svn.apache.org/viewvc?rev=419267&view=rev
Log:
Preserve the original META-INF data of each bundled jar.  Only inlucde "jar" artifacts

Modified:
    incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java

Modified: incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java?rev=419267&r1=419266&r2=419267&view=diff
==============================================================================
--- incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java
(original)
+++ incubator/activemq/trunk/maven-bundle-plugin/src/main/java/org/apache/activemq/maven/BundleMojo.java
Wed Jul  5 09:05:04 2006
@@ -66,7 +66,7 @@
         {
             Artifact a = (Artifact) itr.next();
 
-            if (includeList.contains(a.getArtifactId()))
+            if (includeList.contains(a.getArtifactId()) && "jar".equals(a.getType())
)
             {
                 getLog().info("Found " + a.getArtifactId());
                 
@@ -93,13 +93,32 @@
     
         try
         {
+        	getLog().info("Extracting: "+file+": to "+location);
             UnArchiver unArchiver = this.archiverManager.getUnArchiver( archiveExt );
-    
             unArchiver.setSourceFile( file );
-    
             unArchiver.setDestDirectory( location );
-    
             unArchiver.extract();
+            
+            File metaDir = new File(location, "META-INF");
+            File jarMetaDir = new File(metaDir, file.getName());            
+            FileUtils.mkdir(jarMetaDir.getAbsolutePath());
+            
+            File[] files = metaDir.listFiles();
+            for (int i = 0; i < files.length; i++) {
+				String name = files[i].getName();
+				if( 
+					name.toUpperCase().startsWith("MANIFEST.MF") || 
+					name.toUpperCase().startsWith("COPYRIGHT") || 
+					name.toUpperCase().startsWith("LICENSE") || 
+					name.toUpperCase().startsWith("NOTICE") || 
+					name.toUpperCase().startsWith("DISCLAIMER") 
+				) {
+					
+		            FileUtils.copyFileToDirectory(files[i], jarMetaDir);
+		            files[i].delete();
+				}
+			}
+            
         }
         catch ( IOException e )
         {



Mime
View raw message