Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.5
    • Component/s: manifest
    • Labels:
      None
    • Environment:
      Maven 3.0.3
      Ubuntu 11.04
      Sun java 6 (1.6.0_26)
    • Number of attachments :
      0

      Description

      According to the documentation, using <addClasspath>true</addClasspath> in archive/manifest, should place the generated classpath in to the manifest. This works with assembly:assembly (now deprecated), but is broken in assembly:single

      Here is my plugin definition section:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <configuration>
              <descriptors>
                  <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
              <archive>
                  <manifest>
                      <mainClass>com.example.Main</mainClass>
                      <addClasspath>true</addClasspath>
                      <classpathPrefix>lib/</classpathPrefix>
                  </manifest>
              </archive>
          </configuration>
          <executions>
              <execution>
                  <phase>package</phase>
                  <goals>
                      <goal>single</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      

      and the custom assembly file:

      <assembly>
          <id>full</id>
          <formats>
              <format>jar</format>
          </formats>
          <includeBaseDirectory>false</includeBaseDirectory>
          <dependencySets>
              <dependencySet>
                  <unpack>false</unpack>
                  <scope>runtime</scope>
                  <useProjectArtifact>true</useProjectArtifact>
                  <outputDirectory>lib/</outputDirectory>
              </dependencySet>
          </dependencySets>
          <fileSets>
              <fileSet>
                  <directory>${project.build.outputDirectory}</directory>
                  <outputDirectory>/</outputDirectory>
              </fileSet>
          </fileSets>
      </assembly>
      

      I'm not sure if this is just because the documentation does not correctly address how to do this or if it is actually just broken. I did check the docs and this is how the docs claim you should be able to do this.

        Issue Links

          Activity

          Hide
          Dirk Strauss added a comment -

          Is this a duplicate of MASSEMBLY-334?

          Show
          Dirk Strauss added a comment - Is this a duplicate of MASSEMBLY-334 ?
          Hide
          James Davis added a comment - - edited

          I do not believe so as the generation of items works fine. All that is missing is adding of the classpath to the output manifest file. It works fine if I use any of the deprecated goals, just not the new single goal.

          It does sound similar, however they are trying to execute the assembly:assembly goal which does work fine for me as I stated above.

          Show
          James Davis added a comment - - edited I do not believe so as the generation of items works fine. All that is missing is adding of the classpath to the output manifest file. It works fine if I use any of the deprecated goals, just not the new single goal. It does sound similar, however they are trying to execute the assembly:assembly goal which does work fine for me as I stated above.
          Dennis Lundberg made changes -
          Field Original Value New Value
          Description According to the documentation, using <addClasspath>true</addClasspath> in archive/manifest, should place the generated classpath in to the manifest. This works with assembly:assembly (now deprecated), but is broken in assembly:single

          Here is my plugin definition section:
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-assembly-plugin</artifactId>
              <configuration>
                  <descriptors>
                      <descriptor>src/main/assembly/assembly.xml</descriptor>
                  </descriptors>
                  <archive>
                      <manifest>
                          <mainClass>com.example.Main</mainClass>
                          <addClasspath>true</addClasspath>
                          <classpathPrefix>lib/</classpathPrefix>
                      </manifest>
                  </archive>
              </configuration>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals>
                          <goal>single</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>

          and the custom assembly file:
          <assembly>
              <id>full</id>
              <formats>
                  <format>jar</format>
              </formats>
              <includeBaseDirectory>false</includeBaseDirectory>
              <dependencySets>
                  <dependencySet>
                      <unpack>false</unpack>
                      <scope>runtime</scope>
                      <useProjectArtifact>true</useProjectArtifact>
                      <outputDirectory>lib/</outputDirectory>
                  </dependencySet>
              </dependencySets>
              <fileSets>
                  <fileSet>
                      <directory>${project.build.outputDirectory}</directory>
                      <outputDirectory>/</outputDirectory>
                  </fileSet>
              </fileSets>
          </assembly>

          I'm not sure if this is just because the documentation does not correctly address how to do this or if it is actually just broken. I did check the docs and this is how the docs claim you should be able to do this.
          According to the documentation, using <addClasspath>true</addClasspath> in archive/manifest, should place the generated classpath in to the manifest. This works with assembly:assembly (now deprecated), but is broken in assembly:single

          Here is my plugin definition section:
          {code:xml}
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-assembly-plugin</artifactId>
              <configuration>
                  <descriptors>
                      <descriptor>src/main/assembly/assembly.xml</descriptor>
                  </descriptors>
                  <archive>
                      <manifest>
                          <mainClass>com.example.Main</mainClass>
                          <addClasspath>true</addClasspath>
                          <classpathPrefix>lib/</classpathPrefix>
                      </manifest>
                  </archive>
              </configuration>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals>
                          <goal>single</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          {code}

          and the custom assembly file:
          {code:xml}
          <assembly>
              <id>full</id>
              <formats>
                  <format>jar</format>
              </formats>
              <includeBaseDirectory>false</includeBaseDirectory>
              <dependencySets>
                  <dependencySet>
                      <unpack>false</unpack>
                      <scope>runtime</scope>
                      <useProjectArtifact>true</useProjectArtifact>
                      <outputDirectory>lib/</outputDirectory>
                  </dependencySet>
              </dependencySets>
              <fileSets>
                  <fileSet>
                      <directory>${project.build.outputDirectory}</directory>
                      <outputDirectory>/</outputDirectory>
                  </fileSet>
              </fileSets>
          </assembly>
          {code}

          I'm not sure if this is just because the documentation does not correctly address how to do this or if it is actually just broken. I did check the docs and this is how the docs claim you should be able to do this.
          Hide
          Dennis Lundberg added a comment -

          This seems to be a Maven 3 only issue. It works for me with Maven 2.2.1, but not with 3.0.4.

          Show
          Dennis Lundberg added a comment - This seems to be a Maven 3 only issue. It works for me with Maven 2.2.1, but not with 3.0.4.
          Dennis Lundberg made changes -
          Component/s manifest [ 15762 ]
          Karl-Heinz Marbaise made changes -
          Link This issue relates to MASSEMBLY-334 [ MASSEMBLY-334 ]
          Hide
          Kristian Rosenvold added a comment -

          Fixed with IT in r1632173

          Show
          Kristian Rosenvold added a comment - Fixed with IT in r1632173
          Kristian Rosenvold made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s 2.5 [ 18952 ]
          Assignee Kristian Rosenvold [ krosenvold ]
          Status Open [ 1 ] Closed [ 6 ]

            People

            • Assignee:
              Kristian Rosenvold
              Reporter:
              James Davis
            • Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: