Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-64

jar-with-dependencies has a last-one-copies-wins policy which can fail signed jars

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.1
    • None
    • None

    Description

      I've configured the plugins like this:

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <configuration>
      <archive>
      <manifest>
      <mainClass>ggg.GGGStandaloneApp</mainClass>
      <addClasspath>true</addClasspath>
      </manifest>
      </archive>
      </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
      <descriptorId>jar-with-dependencies</descriptorId>
      <archive> <!-- Please document this -->
      <manifest>
      <mainClass>ggg.GGGStandaloneApp</mainClass>
      </manifest>
      </archive>
      </configuration>
      </plugin>

      BTW: Please document the archive option in the assembly plugin on the assembly site, it took me a while of trial and error to find it.

      However the application doesn't work yet, because:
      Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file entry javax/activation/D
      ataContentHandlerFactory.class
      at sun.security.util.SignatureFileVerifier.verifySection(Unknown Source)
      at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
      at sun.security.util.SignatureFileVerifier.process(Unknown Source)
      at java.util.jar.JarVerifier.processEntry(Unknown Source)
      ...

      It looks like it's because the everything in the META-INF directory have a last-one-copied-wins policy.
      Jar-jar would also solve this of course.

      PS: I am also using acegisecurity, so I belive you can replicate this issue by making an assembly of a HelloWorld dependend on acegi & activation.

      Attachments

        Issue Links

          Activity

            People

              aramirez Allan Q. Ramirez
              ge0ffrey.desmet Geoffrey De Smet
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 5h
                  5h
                  Remaining:
                  Time Spent - 1.5h Remaining Estimate - 3.5h
                  3.5h
                  Logged:
                  Time Spent - 1.5h Remaining Estimate - 3.5h
                  1.5h