File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Soft Skills 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: 5845
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Build Single Module with Dependencies