1 Reply Latest reply on Jul 7, 2017 5:01 AM by bmajsak

    Adding Libraries to JavaArchive

    sharkbite

      Hi

       

      org.jboss.shrinkwrap.api.spec.JavaArchive does have a method like org.jboss.shrinkwrap.api.spec.WebArchive.addAsLibraries()

       

       

       

      What is the workaround for this with Java Archive?

       

      Thanks,

      Daslan

        • 1. Re: Adding Libraries to JavaArchive
          bmajsak

          JAR is not a library container in general - you don't have libs/ folder in your JARs.

           

          Thus Shrinkwrap obviously doesn't have this API method for JavaArchive type. What you can do, however, is to instead of resolving dependencies as File you can instead call .as(JavaArchive.class).

           

          Then simply iterate over those JavaArchives and call .merge on your target archive passing them.

           

          HTH