-
Notifications
You must be signed in to change notification settings - Fork 135
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
How to exclude certain jars from copyDependencies task (duplicate handling strategy) #400
Comments
Hi @streamingdv! I planned to split some JP features into several Maven plugins and Gradle tasks, so you can combine them, e.g, you can call JavaPackager/src/main/java/io/github/fvarrui/javapackager/gradle/AbstractPackageTask.java Lines 40 to 55 in f01e4f0
Anyway, I'll try to reproduce your issue and find a simple solution or a workaround. If you want to do some research by yourself, take a look into this: JavaPackager/src/main/java/io/github/fvarrui/javapackager/gradle/CopyDependencies.java Lines 29 to 43 in f01e4f0
This is the snipet of code which copies dependencies in Gradle. |
Hi again!
The problem is not about duplicated jars, but duplicated modules ( |
Could not find io.github.fvarrui:javapackager:1.7.6-20240421.230018-6 |
It's explained here |
New snapshot released: Now tasks.register('packageApplication', PackageTask) {
// mandatory
mainClass = 'com.grill.app.Launcher'
// optional
bundleJre = true
generateInstaller = true
administratorRequired = false
copyDependencies = true
[...]
duplicatesStrategy = DuplicatesStrategy.[EXCLUDE|FAIL|INCLUDE|INHERIT|WARN]
} and this should work too: tasks.configureEach {
if (it instanceof Copy || it instanceof Zip || it instanceof Tar || it instanceof PackageTask) {
it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
} |
Thanks, it works now with the provided Snapshot. :) |
Please, let's keep this issue open untill it's released |
Branch |
v1.7.6 released to Maven Central |
I'm submitting a…
Short description of the issue/suggestion:
I have a special setup where I include my own compiled 'javafx-graphics-22-win.jar' because I compiled it with enabling the OpenGL rendering pipeline. My own javafx graphics lib is called 'javafx.graphics..jar' which is in my libs folder of my project and it gets imported like this
implementation fileTree(include: ["*.jar"], dir: "libs")
This is my javapackager task
Because of this I have now dublicated graphics jar files in my generated libs folder of javapackager and I get following error when I try to start the application
So in order to mitigate this issue I have another task which deleted the other unwanted graphics jar
This works for the generated exe in the folder but is already too late for the installer, which means my installers will get generated with the additional graphics jar bundled. This leads to the same crash as mentioned above when executing my installed application on a PC (because it bundles the two graphics jar libs).
I tried to name the graphics jar the same as the original (
javafx-graphics-22-win.jar
) but this leads to following errorExecution failed for task ':packageApplication'.
Not sure why I get this erros as I have defined these rules which are working in other tasks
Steps to reproduce the issue/enhancement:
What is the expected behavior?
Would be nice if there is a way to handle such a scenario in JavaPackager, but maybe there is or maybe there is a workaround for that? Maybe a hook to a task which allows you to do certain things before the installer gets created?
What is the current behavior?
I think there is no easy way to handle that scenario with javapackager but I might be wrong?
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: