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

[Question/Suggestion] Redundant relocated jars #37

Closed
0ffz opened this issue Jul 12, 2021 · 1 comment
Closed

[Question/Suggestion] Redundant relocated jars #37

0ffz opened this issue Jul 12, 2021 · 1 comment

Comments

@0ffz
Copy link
Contributor

0ffz commented Jul 12, 2021

I've noticed slimjar generates a copy of every dependency for every application using it under a relocated folder regardless of whether anything was relocated. I'm curious as to whether there's a reason for this, seeing as the files aren't exactly identical in size. If not, is there currently a way to avoid this behaviour?

@Vshnv
Copy link
Member

Vshnv commented Jul 12, 2021

The reason for this was for different applications to be able to share the same downloaded dependency and each have different relocated jars.

Another advantage is to property be able to detect change in the library version with the hash from the repo.

If needed, you can customize the behavior of each component by providing different implementations in the ApplicationBuilder.
Heres what I would recommend for your requirement:

  1. Make an implementation of RelocationHelper that does not generate anything. Use this as the relocationHelper in the application builder.

  2. Make a DependencyDownloader implementation that uses the default impl URLDependencyDownloader and relocates it there itself using JarFileRelocator.

@Vshnv Vshnv closed this as completed Jul 18, 2021
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

2 participants