Reputation: 3683
I have a maven module generating a jar file. I have been asked to develop a couple of other uberjar files as a byproduct of build process. I have also been told these 2 jar files are applet jar files that will be need include some classes from the dependencies of the maven module.
I looked around and narrowed down to these 3 options -
While I can get things working with (b) and (c), I am unable to decide which one to use. One key thing I have noticed is using the dependency plugin is time consuming.
I wanted to know if there are other ways people achieve the same requirement.
Upvotes: 2
Views: 2135
Reputation: 3683
I finally used the assembly plugin using the same approach you described above. I moved away from shade plugin since I generate several assemblies with resources from outside of maven also and shade plugin does not have great support for such tasks.
Upvotes: 0
Reputation: 30089
You can include dependencies using the assembly plugin with the dependencySet
elements, see:
Specifically here's an example taken from Andrew E Bruno's blog:
<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<outputFileNameMapping></outputFileNameMapping>
<unpack>true</unpack>
<scope>runtime</scope>
<includes>
<include>commons-lang:commons-lang</include>
<include>commons-cli:commons-cli</include>
</includes>
</dependencySet>
</dependencySets>
Upvotes: 4