How to manage JAR dependencies from the consuming application

333 views Asked by At

I have created two JAR files. The first contains the core logic to a scheduling service. The second is a Web Fragment Project that contains an optional JSF presentation layer for the former. Each contains its own dependencies in their respective LIB folders and references them in their build path. When I include the packaged JARs in a consumer application, I find myself having to add to the consumer the dependencies that are already packaged in each of the JARs. Is there a way to make make my JAR files "self-sustaining" in that the consumer application does not need to go look for these dependencies and add them to its structure?

1

There are 1 answers

0
Leonardo Diniz On

Are you using Maven?

If so, you could try this one: https://www.mkyong.com/maven/create-a-fat-jar-file-maven-shade-plugin/