Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1
-
Fix Version/s: 1.2
-
Labels:None
-
Environment:all
-
Patch Submitted:Yes
-
Number of attachments :
Description
It would be great if the jarsigner plugin was able to sign all zip files, not only those which contain a META-INF folder and/or jar files as the jarsigner command line tool is not limited to "real" jar files. The META-INF folder is created anyway by the jarsigner tool.
My usecase is that I have some projects that create attached zip assemblies and I would like to sign them, too. I don't want to use e.g. an additional ant task attached to the verification phase, as the signing should be done automatically imho. And I don't want to use "external" signing tools like gpg as it requires a manual installation of that tool whereas the jarsigner is always present (in a JDK).
Simply replace the isJarFile method like that or similar:
private boolean isZipFile( final File file )
{
try
{
// NOTE: ZipFile.getEntry() might be shorter but is several factors slower on large files
ZipInputStream zis = new ZipInputStream( new FileInputStream( file ) );
try
finally
{ zis.close(); } }
catch ( Exception e )
return false;
}
Done in r817056.