-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC - JAR of JARs #123
base: 4.6.x
Are you sure you want to change the base?
POC - JAR of JARs #123
Conversation
Spring's "repackage" goal (in the Spring Boot Maven Plugin), does something similar to this, but as you mentioned above, removes the need for unpack the jar first. The actual "spring" dependencies on that project are minimal (if any at all, the last I looked) The resulting package ends up looking like this:
I've been using this even on non-Spring projects just to avoid using the Shade plugin. |
@bdemers thanks, this was just a POC I did right before leaving the Micronaut team. Going forward, @melix and @graemerocher should be able to decide in which direction they want to move. |
Can we take inspiration or borrow something from One Jar? The project seems to be dead but works in general. Will be very useful in this case. |
FYI, we don't have plans to spend time on this in the short term, the interest by the community seems low. |
SonarCloud Quality Gate failed. 3 Bugs No Coverage information |
This PR contains a POC that fixes #104:
io.micronaut.build:micronaut-entrypoint
artifact with a single class (io.micronaut.build.entrypoint.Entrypoint
) that is meant to be theMain-Class
of the runnable jars.URLClassLoader
that loads dependencies (included in the JAR'slibs/
folder) by copying them to the local file system first, since nested JAR URLs aren't supported byURLClassLoader
. Ideally, this should be replaced by a custom class loader that is able to read nested JAR URLs.micronaut-entrypoint-test
test application, coming from a vanillamn create-cli-app
, with the following changes to its POM:classes/libs
so that they end up being inside the JAR.micronaut-entrypoint
in theclasses
directory, since it needs to be exploded to be the JAR's main class.Class-Path
entry contains all the dependencies in the formatlibs/foo-1.2.3.jar
.Main-Class
is fixed toio.micronaut.build.entrypoint.Entrypoint
.Micronaut-Entrypoint
points to the actual main class (io.micronaut.build.entrypoint.test.MainCommand
in this case).The generated JAR looks like: