• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 15615
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic