• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Unable to create one single jar file in maven with dependencies included inside

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Currently my application was simple core java and hibernate which was non-compatible with the maven directory structure. I had to change my project to a maven project.
I had one Java project A which used another Java project B to create a fat jar. Previously I used the eclipse fat jar plugin in which all the dependencies including Java project B where getting included as jar inside the lib folder of Java project A's jar.
Now i have created one parent project and included the Java project A and Java project B as modules inside it. Its building and the jars are created, but Java project B's compiled jar and other dependencies are not inside Java project A's jar now the same way they used to be earlier. So now if i execute my Java project A's jar, it throws error as class files for Java project B and other dependencies are not found in the class path. I want one single jar that's portable and there should be no need to set classpath at client's environment.

I have used the following links with limited success.

http://www.synthesisstudios.com/blog/2006/08/18/using-maven2-to-build-a-single-stand-alone-jar-file/
http://www.javaworld.com/javaworld/jw-12-2005/jw-1205-maven.html
http://www.thekua.com/atwork/2008/10/generating-a-single-fat-jar-artifact-from-maven/
http://gabrito.com/post/building-one-big-fat-jar-file

My Parent POM :


Module A's POM :



ModuleB's pom:



Please guide and help
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your description after "but" was cut off so we're not sure what the problem is . Also I recommend following "Maven the Definitive Guide", the free online PDF (and hard cover book) by Sonatype who are pretty much the creators of Maven
 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Martijn Verburg wrote:Your description after "but" was cut off so we're not sure what the problem is



Updated my earlier description
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic