I have a project that combines several JARs into one. To avoid warnings I filter the META-INF/MANIFEST.MF from all of the JARs except the one that contains the main class. However, the manifest in the resulting JAR then specifies a class path that includes all of the original JARs. It looks like it's just the same manifest from the JAR containing the main class. Is there a way for a more accurate manifest to be created for the combined JAR which specifies a class path of just the final JAR?
Thanks,
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One approach is to strip out the MANIFEST.MF file altogether and add a new hand-written one after Proguard is done. Unfortunately, Proguard has very little in the way of handling MANIFEST.MF.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a project that combines several JARs into one. To avoid warnings I filter the META-INF/MANIFEST.MF from all of the JARs except the one that contains the main class. However, the manifest in the resulting JAR then specifies a class path that includes all of the original JARs. It looks like it's just the same manifest from the JAR containing the main class. Is there a way for a more accurate manifest to be created for the combined JAR which specifies a class path of just the final JAR?
Thanks,
John
One approach is to strip out the MANIFEST.MF file altogether and add a new hand-written one after Proguard is done. Unfortunately, Proguard has very little in the way of handling MANIFEST.MF.
Thanks very much cowwoc, but how would I add the hand-written manifest to the created JAR?
John
I believe "jar -u" will do it. The <jar> ant task also supports updating existing JAR files.
Gili
Alternatively, you can prepare a manifest file in advance, put it in a jar, and just specify it as input to ProGuard:
-injars manifest.jar
-injars program1.jar(!META-INF/**)
...
-outjar result.jar
Eric.
OK great - thanks again.
John