mojohaus / rpm-maven-plugin

http://www.mojohaus.org/rpm-maven-plugin/
Other
56 stars 48 forks source link

Executable jar is compressed when packaging through RPM #106

Open Dhruwnath opened 6 years ago

Dhruwnath commented 6 years ago

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 commented 6 years ago

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

jayantkeswani commented 6 years ago

I'm having the same issue.

BenEfrati commented 5 years ago

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 commented 4 years ago

@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.