0

I'm trying to create a jar which will contain the other runtime dependencies jars.

I used following script

<jar destfile="MyApplication.jar">
  <zipgroupfileset dir="lib" includes="*.jar" /> 
  <!-- other options -->
  <manifest>
    <attribute name="Main-Class" value="Main.MainClass" />
  </manifest>
</jar>

When I say other runtime dependencies jars, I was thinking those will be added as a full jar inside MyApplication.jar

Something like below.

MyApplication.jar

 --`lib/depedent1.jar`
 --`lib/depedent2.jar`
 -- my.class
 -- myAnother.class

But, what I found MyApplication.jar actually have all extracted content of lib/depedent1.jar/lib/depedent2.jar

I don't have any issue if the content is extracted but just curious that wouldn't it possible to create a jar with actually distinguished dependent jars inside?

Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92

1 Answers1

0

Basically, Shaded/fat jar extract the content of dependencies inside it's parent jar

MyApplication.jar

-- com.lib1.corp.SomeClass.class
-- com.lib2.corp.AnotherClass.class
-- com.my.corp.myFirst.class
-- com.my.corp.myAnother.class
Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92