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

Enable compression on resources in primary jar #45

Open
joeljeske opened this issue Oct 16, 2020 · 3 comments
Open

Enable compression on resources in primary jar #45

joeljeske opened this issue Oct 16, 2020 · 3 comments

Comments

@joeljeske
Copy link

Springboot forbids compression nested jars/archives, however, it does not (to my knowledge) forbid compression assets in the top-level jar. This rule set does disables all the compression on the final artifact, which can result in much higher archive sizes compared to the same application built in gradle for example.

It would be helpful to only disable compression on jars within the top level jar.

@plaird
Copy link
Contributor

plaird commented Oct 16, 2020

@joeljeske thanks for the report, I believe you are correct that the resource entries in the outer jar can be compressed.

@plaird
Copy link
Contributor

plaird commented Dec 11, 2020

I looked into this, this won't be easy. We are jar'ing up the whole mess in a single jar command in the packaging rule

https://github.com/salesforce/bazel-springboot-rule/blob/master/tools/springboot/springboot_pkg.sh#L181

I don't see an easy way to selectively compress some files and not others. To support Windows #25 , I am starting to wonder if we need to rewrite the packaging rule in Java. If we do that, we could also solve this pretty easily.

@plaird
Copy link
Contributor

plaird commented Dec 17, 2020

As of #72 we are now building the executable jar file using multiple invocations of jar command. This is possible because jar has an "update" option. For #72, we are doing this to insure insertion order is deterministic for classloading reasons. I wonder if this same technique could be used to compress some entries but not others.

@plaird plaird removed the v3_rewrite label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants