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

Executable jar is compressed when packaging through RPM #106

Open
Dhruwnath opened this issue Aug 21, 2018 · 4 comments
Open

Executable jar is compressed when packaging through RPM #106

Dhruwnath opened this issue Aug 21, 2018 · 4 comments

Comments

@Dhruwnath
Copy link

I am building RPM through rpm-maven-plugin and packaging another packaged single FAT jar file. The jar is executable and its running file when manually copy past to Linus box. Its getting failed when running after installing the RPM build through rpm-maven-plugin. Its giving error message "invalid file (bad magic number): Exec format error"

When I tried to run through Java -jar installed-app.jar its says Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/antlr-2.7.7.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file

It seems jar is getting either compressed or repackaged with other format. How can I ensure my executable jar is getting stored in RPM without any compression or repackaging?

@dantran
Copy link
Contributor

dantran commented Aug 22, 2018

looks like you are putting a spring-boot uber jar inside an RPM? can you make a sample pom to produce the issue?

@jayantkeswani
Copy link

I'm having the same issue.

@BenEfrati
Copy link

BenEfrati commented Dec 31, 2018

What is the OS that you build the RPM?
Did you try this:
https://www.mojohaus.org/rpm-maven-plugin/ident-params.html#repackJars
See the repackJars section

https://stackoverflow.com/a/32275674

If you're using CentOS 5, check the following solution:
https://stackoverflow.com/a/32251633

@chandralekhasekar
Copy link

chandralekhasekar commented Dec 5, 2019

@BenEfrati that seems to be the solution, atleast when i had this issue disabling repackJars helped with the spring boot error. Also it speeds up the rpm generation time which makes sense not to compress an already compressed file as we are not going to gain much out of it.

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

5 participants