jar-tool properly skipping Manifest file using entry's jarPath
Review Request #3437 - Created Feb. 8, 2016 and submitted
|gmalmquist, jsirois, stuhood, zundel|
entryPath=="MANIFEST.MF", the check for
JarFile.MANIFEST_NAME.equals(entryPath)will always be false, instead we
should check entry's jarPath, i.e, the path that's to be written into the jar.
This is surfaced by an uncommon new use case: some applications like scalding
need two main functions in their jars. The second main is supplied as a
Now when running binary,
manifest.mf is not skipped because of the above, and results
duplicate entry: META-INF/MANIFEST.MFerror.
Note: for binary, skipping the 2nd manifest is the appropriate action. Because
there is only one manifest/main for the binary jar. For bundle, this code path
is not executed because we only generated synthetic classpath now.
This is the proper fix. Previous diff has accidentally committed local testing code
Revision 2 (+23 -3)