*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to split my java application into multiple jars based on modules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to split my java application into multiple jars based on modules" Watch "How to split my java application into multiple jars based on modules" New topic
Author

How to split my java application into multiple jars based on modules

monicka rk akilan
Greenhorn

Joined: Jan 04, 2013
Posts: 8
I have one java web application developed in spring. Now i want to split the application into multiple jars based on modules for different customer requirement.

I followed package structure for different modules like

I want to make these into two jars based on the module also having some packages and login module.

Am using Eclipse and ANT

I don't know how and where to start. Please advice me.

Advance Thanks for your valuable comments.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

I suggest using Maven instead of ANT. Its much less verbose and handles multi-module projects like this very easily. Either direction you go this is really a build tools question so I will move it to a more appropriate forum for you.


[How To Ask Questions][Read before you PM me]
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3598
    
  14

monicka rk akilan wrote:I want to make these into two jars based on the module also having some packages and login module.


What do you mean by this sentence?

Anyway, like Bill said, Maven is the way to go. Create a directory structure like this:
Then your modules' pom files should look something like this:
The project's pom should look like this:
After you've installed Maven, you can just open a command prompt in your project folder, and run mvn package, and a jar of each of your modules should appear in the target folder of that module, e.g. Project/Abc/target/abc-0.1.0.jar.
 
 
subject: How to split my java application into multiple jars based on modules
 
Similar Threads
Best practices for setting up modules with interdependencies in CVS
How add dependency of existing module of project to another module of the same project
maven-ear-plugin: jarModule or ejbModule
Build Single Module with Dependencies
How t o have multiple log files in WSAD and WAS using log4j ?