maven assemblies. Putting each dependency with transitive dependencies in own directory?

Posted by jr on Stack Overflow See other posts from Stack Overflow or by jr
Published on 2010-04-20T04:26:26Z Indexed on 2010/04/20 4:33 UTC
Read the original article Hit count: 274

I have a maven project which consists of a few modules. This is to be deployed on a client machine and will involve installing Tomcat and will make use of NSIS for installer. There is a separate application which monitors tomcat and can restart it, perform updates, etc.

So, I have the modules setup as follows:

project
  +-- client (all code, handlers, for the war)
  +-- client-common - (shared code, shared between monitor and client)
  +-- client-web - (the war, basically just uses war has applicationcontext, web.xml,etc)
  +-- monitor - (the monitor application jar. Uses wrapper to run)

So, I need to create an installer. I was planning on creating another module which would be the installer. This is where I would have tomcat directory and I'd like maven to "assemble" everything and then run NSIS so I can create the final installer.

However, I need to have the monitor jar file in a directory and then have all monitors dependencies in a lib/ directory. The final directory structure should be:

project-installer-directory/monitor/monitor-version.jar
project-installer-directory/monitor/lib/monitor-dep-1.jar
project-installer-directory/monitor/lib/monitor-dep-2.jar
project-installer-directory/monitor/lib/monitor-dep-3.jar
project-installer-directory/webapps/client-web.war

Where in the client-web\WEB-INF\lib directory we will have all client-web's dependencies after it is exploded. That works, I have the .war file. What I am having problems with is getting the monitor module dependencies independent of the dependencies of the client-web module.

I tried to just create the installer module and make the monitor and client-web dependencies, but when I use dependencies-copy it gives me everything. Not what I want.

I'm leaning towards creating a new module called monitor-assembly or something to give me a zip file which contains the directory format I need, but that is yet another module.

Can someone please help me with the correct way to accomplish this?

thanks!

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about maven-assembly-plugin