Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-277

JarSignerUtil.unsignArchive invalid entry compressed size

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • maven-jarsigner-1.0
    • maven-jarsigner-1.1
    • maven-jarsigner
    • None
    • Java 6, Windows 7, Maven 3.0.5

    Description

      You can check the attached file with "org.apache.maven.plugins:maven-jarsigner-plugin:1.2:verify" and everything is fine. But if you want to use "org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign" and use the "removeExistingSignatures" option, you get the following error:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (sign) on project unsign: Failed to unsign archive javax.persistence_2.0.5.v201212031355.jar: invalid entry compressed size (expected 6375 but got 6495 bytes) -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (sign) on project unsign: Failed to unsign archive javax.persistence_2.0.5.v201212031355.jar: invalid entry compressed size (expected 6375 but got 6495 bytes)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to unsign archive C:\Projekte\Java\SE\aktuelle\unsign\javax.persistence_2.0.5.v201212031355.jar: invalid entry compressed size (expected 6375 but got 6495 bytes)
      at org.apache.maven.plugins.jarsigner.JarsignerSignMojo.unsignArchive(JarsignerSignMojo.java:252)
      at org.apache.maven.plugins.jarsigner.JarsignerSignMojo.preProcessArchive(JarsignerSignMojo.java:204)
      at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.processArchive(AbstractJarsignerMojo.java:418)
      at org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo.execute(AbstractJarsignerMojo.java:263)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
      Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 6375 but got 6495 bytes)
      at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:248)
      at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:177)
      at org.apache.maven.plugins.jarsigner.JarsignerSignMojo.unsignArchive(JarsignerSignMojo.java:244)
      ... 24 more

      I have bypassed the problem with a small patch in JarSignerUtil line 107:

      zos.putNextEntry( new ZipEntry(ze.getName()) );

      Can you fix it please.

      Attachments

        1. javax.persistence_2.0.5.v201212031355.jar
          150 kB
          Kai Zimmermann
        2. MSHARED-277.patch
          1 kB
          Timo Meinen

        Activity

          People

            tchemit Tony Chemit
            nachtgold Kai Zimmermann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: