Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven-assembly-plugin

I'm trying to add a classpath to the jar generated by the maven-assembly-plugin. The assembly bulids, except the manifest has no classpath. Below is my configuration. Any help would be appreciated. Thanks!

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
        <goal>assembly</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <descriptors>
      <descriptor>assembly/package.xml</descriptor>
    </descriptors>
    <archive>
      <manifest>
        <mainClass>mymain.Main</mainClass>
        <addClasspath>true</addClasspath>
      </manifest>
    </archive>
  </configuration>
</plugin>
like image 545
Jeff Storey Avatar asked Jul 02 '09 14:07

Jeff Storey


1 Answers

I see you are using a custom assembly descriptor. But the plugin's documentation page has this to say about the <archive> element:

At this point, only the jar assembly format supports the <archive> configuration element. By definition, directory-based assembly mojos - assembly:directory, assembly:directory-inline, and assembly:directory-single - do not produce a jar-format archive, and therefore do not support the <archive> element.

like image 66
lindelof Avatar answered Sep 18 '22 07:09

lindelof