0

I expect this is trivial, but I'm on a deadline, so I apologise if this is a stupid question.

I'm using Dr Tuffs OneJar for Maven to build a fat jar including all my dependencies etc. However, when I use jar tf xxx.one-jar.jar it lists the things I'd expect, like my normal jar, but also all of Dr Tuffs code. The below is just an excerpt from the command:

com/
com/simontuffs/
com/simontuffs/onejar/
.version
OneJar.class
com/simontuffs/onejar/Boot$1.class
com/simontuffs/onejar/Boot$2.class
com/simontuffs/onejar/Boot$3.class
com/simontuffs/onejar/Boot.class
com/simontuffs/onejar/Handler$1.class

I'm hoping there's a property I can set in my pom file to stop it doing this.

Will
  • 1,568
  • 2
  • 12
  • 28
  • Check this: http://blog.dub.podval.org/2009/10/creating-executable-jars-with-maven.html you have to add the one-jar jar as excluded in maven – Pablo Lozano May 22 '14 at 10:42
  • 1
    And this is what's so great about SO - 7 minutes to get help. Awesome. I'll take a look at that blog and post my solution unless someone beats me to it. Thanks Pablo. – Will May 22 '14 at 10:48
  • Pablo - if you want to put that as an actual answer I'll accept. – Will May 25 '14 at 10:13

1 Answers1

1

Check this link you have to add the one-jar jar as excluded in Maven pom.xml file.

Pablo Lozano
  • 10,122
  • 2
  • 38
  • 59