-
Notifications
You must be signed in to change notification settings - Fork 10
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
Set duplicates strategy for all archive tasks #335
Set duplicates strategy for all archive tasks #335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work to also add:
project.tasks.withType(BootJar).configureEach {
it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
if this is also a problem for the bootJar
task?
Do we know why there are duplicates in the first place? I am not sure if it's safe to set either EXCLUDE or INCLUDE without knowing the complete details. |
@matrei Once I moved this to https://github.com/grails/grails-gradle-plugin/pull/335/files#diff-ba565babe68414f1c32db2b36014959f80160aa25fa7f7953353c5f120fa4d17 from grails-core, it worked on bootJar without any extra configuration. My assumption was that the |
Here are other places across the codebase which currently set a duplicates strategy: https://github.com/search?q=org%3Agrails%20duplicatesStrategy%20%3D&type=code For this specific instance:
digging deeper: We are using com.sun.xml.bind:jaxb-core:4.0.5
and hibernate-core-jakarta:5.6.15.Final is using org.glassfish.jaxb:jaxb-core:4.0.5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test this out 👍
I've eliminated the duplicate jar with the following PRs grails/gorm-hibernate5#891 This will likely make this PR moot. |
Well, that would be even better 👍 |
Currently a Grails 7 application will require specifying the duplicatesStrategy for the following tasks.
This should be defined at a higher level in
GrailsGradlePlugin
, so it is not necessary to set it in each Grails project/application.The Zip format supports duplicates, gradle implements this zip feature and puts duplicates into the archives, so EXCLUDE is a better option.
Examples
https://github.com/grails/grails-async/blob/7.0.x/examples/pubsub-demo/build.gradle#L55-L65
https://github.com/grails/grails-views/blob/577d1c5bea1d88d446dbc7d48f950bfe3160fb0e/examples/functional-tests/build.gradle#L60-L66