This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
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 Customer Requirements for Developers this week in the Jobs Discussion 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
Author

Build Single Module with Dependencies

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

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,

Niall
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5852
    
    7

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
 
jQuery in Action, 3rd edition
 
subject: Build Single Module with Dependencies
 
It's not a secret anymore!