Jason van Zyl wrote:

Author: jvanzyl
Date: Thu Jul 17 13:48:21 2008
New Revision: 677718

URL: http://svn.apache.org/viewvc?rev=677718&view=rev
Log:
MSHADE-39: add a resource transformer that takes care of MANIFEST.MF files

maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/resource/ManifestResourceTransformer.java
 (added)
+ + jos.putNextEntry( new JarEntry( MANIFEST_PATH ) );
+        StringBuffer sb = new StringBuffer();
+        for ( Iterator i = attributes.keySet().iterator(); i.hasNext(); )
+        {
+            Attributes.Name a = (Attributes.Name) i.next();
+ sb.append( a.toString() ).append( ": " ).append( attributes.getValue( a ) ).append( "\n" ); + } + InputStream is = new StringInputStream( sb.toString() );
+        IOUtil.copy( is, jos );

The implementation as is does not respect the Manifest specification [0], e.g. neither UTF-8 encoding nor 72 bytes maximum line length is used. Didn't Manifest.write(OutputStream) work for you?


Benjamin


[0] http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Manifest%20Specification

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to