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: are jar files compressed? #1046

Closed
avkonst opened this issue Oct 19, 2017 · 5 comments
Closed

question: are jar files compressed? #1046

avkonst opened this issue Oct 19, 2017 · 5 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@avkonst
Copy link

avkonst commented Oct 19, 2017

  • I would like to understand if jar files, produced by the plugin, are compressed? It seems they are copied as is from the maven repository.
  • How can I change the compression level? If it is not possible, would it be possible to add this feature?

Clarification: my goal is to produce the smallest-footprint of working java application (footprint is measured by the size of unpacked tarball content produced by the universal build).

Information

  • What sbt-native-packager are you using
    Universal
  • What sbt version
    0.13.x
  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
    Windows, Ubuntu
  • What package are you building (e.g. docker, rpm, ...)
    zip tarbals
  • What is your target system (e.g. Ubuntu 16.04, CentOS 7)
    java (OS independent)
@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Oct 24, 2017
@muuki88
Copy link
Contributor

muuki88 commented Oct 24, 2017

Hi. Thanks for your question.

native-packager doesn't alter the resulting jars in any way. It takes it as sbt produces them via the packageBin task. IIRC jars are actually zip files so they are already compressed.

@dwijnand may know more about the packageBin task?

@dwijnand
Copy link
Member

Yeah jar files are glorified zips, so mildly compressed.

I did hear a rumour though that there's an alternative, better compression algorithm that was merged into the jdk years and years ago but no-one uses. If better compression is your need, maybe you should look into that claim.

@muuki88
Copy link
Contributor

muuki88 commented Oct 25, 2017

Thanks @dwijnand 😄

@avkonst if you find something interesting regarding a better jar compression, it would be awesome if you share it here and repopen the issue. Maybe there is a way to integrate it in native-packager.

@muuki88 muuki88 closed this as completed Oct 25, 2017
@matanox
Copy link

matanox commented Sep 1, 2019

At the core, do all jars built with sbt package and sbt assembly (using Java 8) compress all files included in them?

@muuki88
Copy link
Contributor

muuki88 commented Sep 17, 2019

neither of those tasks are part of sbt-native-packager.

sbt assembly comes from the sbt-assembly plugin and package is IIRC from sbt itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

4 participants