Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
monicka rk akilan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stephan van Hulst
Bartender
Pie
Posts: 5810
61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic