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?
Asked
Active
Viewed 283 times
1
-
If your jar is part of a maven artifact then your consumer should be using maven so the dependencies are met automatically. If for some reason, consumer cannot be a maven project, what you are looking for is a fat jar - a jar that included all the dependent jars. This is tedious to construct if you do not have a dependency management system like maven. – Sanketh Feb 02 '18 at 06:28
1 Answers
0
Are you using Maven?
If so, you could try this one: https://www.mkyong.com/maven/create-a-fat-jar-file-maven-shade-plugin/

Leonardo Diniz
- 61
- 3