Reputation: 57212
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>
Upvotes: 8
Views: 8979
Reputation: 2348
It doesn't add classpath but adds main-class because there is a bug http://jira.codehaus.org/browse/MASSEMBLY-334
Upvotes: 4
Reputation: 35250
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.
Upvotes: 7