aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Build Single Module with Dependencies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Build Single Module with Dependencies" Watch "Build Single Module with Dependencies" New topic

Build Single Module with Dependencies

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 203

I have a project where there are multiple modules within the project base pom.xml,

There is a module "moduleA" that is a standalone JAR that is dependent on another module "moduleB" within the project,

Is it possible to build module "moduleA" JAR file and within this JAR file there will be a lib folder that contains module "moduleB" code,

Thanks in Advance,

Peter Johnson

Joined: May 14, 2008
Posts: 5772

You can use the Assembly plugin to do this.

By the way, the default classloader will not load a nested JAR, so you will need some code to do that (if Eclipse builds a JAR with nested JARs it includes such a classloader). You might be better off just adding the classes from module B into the JAR for module A; and not in a lib folder because that will mess up the classpath.

JBoss In Action
I agree. Here's the link:
subject: Build Single Module with Dependencies
Similar Threads
Best practices for setting up modules with interdependencies in CVS
Unable to create one single jar file in maven with dependencies included inside
Can I have multiple DispatcherServlet instantance.
webservice not accessible
recursive dependency!? (circular dependency) - Resolved