Maven 2 build plugin - how to break the main artifacts and dependencies into separate folders

I am using the Assembly plugin for maven to create the installation package.

For my packaging requirements, I need to break the artifacts created during assembly and all the dependencies into separate folders.

My current Assembly manifest is as follows:

<moduleSets> <moduleSet> <includes> <include>test:test</include> </includes> <binaries> <includeDependencies>false</includeDependencies> <outputDirectory>lib/custom/${artifactId}</outputDirectory> <unpack>false</unpack> </binaries> </moduleSet> <moduleSet> <includes> <include>test:test</include> </includes> <binaries> <includeDependencies>true</includeDependencies> <excludes> <exclude>test:test</exclude> </excludes> <outputDirectory>lib/thirdParty/</outputDirectory> <unpack>false</unpack> </binaries> </moduleSet> </moduleSets> 

The first module correctly generates only the assembly that is currently assembled. However, thirdParty also includes the build now. How can I exclude files already included in the first set?

thanks

+4
source share
3 answers

How about using dependency: copy-dependency? I use this to copy all the depots to target / lib.

+1
source

One way to do this is with the maven-antrun-plugin and ant task. Iterate the contents of lib / custom / $ {artifactId} and delete any files from lib / thirdParty.

0
source

You might want to check out the appassembler-maven-plugin . It allows you to reset all your bans depending on the runtime in the directory. You might be able to hack this to put the main jar in one folder and then dump the dependencies into another.

0
source

All Articles