How to pack jar dependecies in JavaEE web-fragment project?

605 Views Asked by At

I have a web-fragment project. The output of this project is a JAR FILE called fragment.jar.

This fragment.jar is then copied into my MAIN PROJECT's WEB-INF/lib. Of course, output of the main project called is a war file called web.war.

The fragment.jar has web-fragmnet.xml in it. The whole war file is deployed to WildFly 9. Wildfly recognizes the fragment.jar as a web-fragment. However, Inside the web-fragment, there are some JSF files with dependencies for Primefaces. What I don't know is where to put the Primefaces dependencies (jars) to avoid ClassNotFound exceptions.

I tried to create Gradle multiproject builds, having the fragment itself as a subproject. This works, Gradle copies all the subproject dependencies into WEB-INF/lib. This however, requires the whole project to be present on the machine. But I want to be able to distribute just the fragment.jar with all it's dependencies.

EDIT: I've tried to create a fat jar using Gradle's ShadowPlugin. Things moved on a little, but this time I get another exceptions: EXCEPTIONS

0

There are 0 best solutions below