Skip to content
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

Proposal: multiple output JARs to avoid merges #37

Open
hlship opened this issue Mar 2, 2024 · 0 comments
Open

Proposal: multiple output JARs to avoid merges #37

hlship opened this issue Mar 2, 2024 · 0 comments

Comments

@hlship
Copy link
Contributor

hlship commented Mar 2, 2024

I had an idea about how to avoid merging.

What if vessel created a series of JARs; the first jar, let's call it main.jar contains the compiled AOT sources and most resources.
When there's a conflict (a resource already exists in main.jar), a new JAR (let's call it resources_0.jar) is created to contain it.

Basically, layers. When a file conflicts with something in the main layer, we find or create a new layer where it can live.

The final result is the main JARs, and 0 or more resources JARs. We just ensure that all of these are on the classpath in the running application (i.e., load them all into WEB-INF/lib, or something equivalent for non-WAR applications).

When I went down the rabbit hole of merging resources, it's because the thing I wrote (which looks for a particular set of files on the classpath) works fine for REPL development, but couldn't work in production because in a JAR each file can appear only once.

I'm also looking to see if there's a way to build a JAR file where the same file occurs multiple times. Nope, there isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant