Uploaded image for project: 'Maven Jar Signer Plugin'
  1. Maven Jar Signer Plugin
  2. MJARSIGNER-7

jarsigner plugin to support all "types" of zip files

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1
    • 1.2
    • None
    • all
    • Patch

    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

      { return zis.available() == 1; }

      finally

      { zis.close(); }

      }
      catch ( Exception e )

      { // ignore, will fail below }

      return false;
      }

      Attachments

        Activity

          People

            bentmann Benjamin Bentmann
            mscholl M.S.
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: