2 Replies Latest reply on Oct 16, 2010 4:45 AM by Aslak Knutsen

    UberJar archive type

    Dan Allen Master

      I thought of another useful container type for ShrinkWrap. So far the only nested Java archives we've created have been Java EE standard archives. Another common archive packaging is the UberJar (or as Maven calls it, a shaded JAR). An UberJar is a JAR containing other JAR files. What makes it unique, though, is that when it's exported, those jars are flatted into a single non-nested JAR.


      I'm thinking we call this archive a UberJavaArchive or ShadedJavaArchive. It would be a LibraryContainer only, but somehow we need to weave in this merging export feature...perhaps something like:


      JavaArchive shaded = ShrinkWrap.create(JavaArchive.class, "shaded.jar");
      UberJavaArchive container = ShrinkWrap.create(UberJavaArchive.class, "uber.zip");


      prints (assuming a.jar has class A and b.jar has class B)




      This functionality would be especially useful in build tools.