Anthony
Anthony

Reputation: 43

Build multiple projects and dependencies into one jar file

I want to package in a different way a Java application in order to build the associated Docker image. Basically the current configuration is to build the Docker image based on a folder containing 2 directories :

What I would like to do is to create a JAR file containing the content of those two folders.

The Java projects are not all dependent, but there is one defining objects that are used in other projects. I am currently looking for a way to package all of these projects into one JAR. I found a tool called OneJar that would solve my problem, but I am not sure if this would be the right way..

Do you have some suggestions on the way to proceed ?

Thanks !

Upvotes: 0

Views: 615

Answers (1)

Philippe Peter
Philippe Peter

Reputation: 85

With maven:

You can also look at the google jib project https://github.com/GoogleContainerTools/jib

Upvotes: 1

Related Questions