-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support Repackaging of Pre-Existing Nested Jar Files/Disable Modifying Input Jar #83
Comments
The underlying As far as I understood your problem, you are saying that the jar-file isn't compressed anymore? |
No, I mean that the nested library jars which are already included in the input jar-file are being compressed when it is re-created, which makes them not useable by the class loader it seems. I need them same mechanism used to originally store the library jars into the I will give more detail. My input jar-file is made with the Spring Boot plugin, which essentially packages all library jars together with the application and avoid having to set the classpath in the In case you were wondering, the exception I am receiving is from the Spring Boot dynamic loader (so it may not be as relevant here): |
Hm, seems this is a conflict with a Spring Boot then. Can you create a small project for me, where I can re-create this situation? Does not have to be productive code, just the bits and pieces which are required to get this Exception. |
I'm flagging this as But to be honest, I'm pretty interested in this project-type, never crossed my mind to combine Spring Boot with JavaFX launchers. |
I attached the MVCE. It is an Intellij project on Java 8. Steps to reproduce:
You will notice that the main class is If you unzip the jar-file |
Hi there, yes I see the problem, and it is the JDK itself which does re-compress the jar-file (not the javafx-gradle-plugin). As I'm reworking this plugin for Java 9 compatibility (and some interface changes), there is no quick solution for this problem. Even on current JDK 9 this bug is existing. Maybe you want to open a new issue at the official Java bugtracker from Oracle? |
Alright, I'll try that. Do you have a link to their bugtracker? I can't find it on Google. |
Just start here: http://bugreport.java.com/
When you have some feedback from oracle, please report it back here, so others can find this (and I can check when it gets fixed, ...or getting closed as "won't fix"). Just refere to javapackager when reporting, but you can add this issue as some reference. The bug is that when repackaging an existing JAR, they do not take care of the packaging method (STORE or DEFLATE). |
It is an internal review, so I am not sure if it is publicly viewable. |
All reports will be converted into real JDK-issue-numbers, have done this several times :) they make it to separate unconfirmed bugs and real bugs, like a pre-filtering system. You will get the real JDK-number after they evaluated your issue. |
Thanks for the update, will check the sources what they changed, and if I need to add some workaround for older versions. For reference, the link to the openjdk-jira: https://bugs.openjdk.java.net/browse/JDK-8187357
Will wait some days for re-checking this. |
@arminnaderi can you recheck this using current JDK 8?
|
After evaluation with JDK 10, this still is relevant, and still inside the JDK. |
Hi there, Is there a some perspective to resolve this issue? |
Following workaround worked for me, I am using plugin only for building native package. Build a jar using spring bootJar task. It is by default enabled, though just to make sure Gradle builds jar using spring bootJar task.
Disable the jfxJar task. Provide
Let me know if there are any side-effects, thanks. |
I currently have a pre-packaged executable JAR file (from
java -jar
) that I am passing into this plugin. I have specifiedskipCopyingDependencies = true
, as the dependencies are already packaged into the JAR file.The problem is that this plugin repackages the existing jar as shown in this debug message:
Updating jar file: ${FILE_SYSTEM_PATH}/application.jar
. This message is provided when I set theupdateExistingJar = true
property.I solved this problem manually by taking the
.app
output fromjfxNative
, and replacing the modified JAR with the original JAR file that is passed to this plugin. The application worked as intended.Is is possible to modify the input JAR without changing the ZIP compression of the library directory from a
STORE
type of compression OR disable modification of the input JAR?Thanks for reading.
The text was updated successfully, but these errors were encountered: