-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix rest client causing jarHell for gradle 3.5+ #25892
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
Conversation
client/rest/build.gradle
Outdated
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.
Why not just check the version of gradle that is running to determine which configuration to manipulate? See GradleVersion.
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.
I could do that too. This also works w/o any conditional logic tho for all the 3.x and 4.0. Those comments are more notes mentioning why we are removing each one. Im fine either way with it.
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.
Ill go ahead and do that to prevent the extra configuration from being created in 3.3
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.
fixed in 752f2db
The configuration removed from the runtime configuration did not properly remove the deps jar from gradle versions > 3.3. The rest client now removes both the 3.3 and 3.3+ configurations so this works on both versions of gradle. It also cleans up issues caused by shadowJar and shadeDeps causing no dependencies to be put on the classpath. Relates elastic#25208
440e025 to
7472c77
Compare
client/rest/build.gradle
Outdated
| configurations.runtime.artifacts.removeAll { it.archiveTask.is jar } | ||
|
|
||
| // removes the runtime configuration inheritance from compile | ||
| // runtimeElements does not exist in 3.3 |
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.
we should probably use the GradleVersion for a conditional here as Ryan suggested.
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.
oh sorry. didn't see you already said you're on it (as the previous collapsed convo reflects)
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.
fixed in 752f2db
|
Since elasticsearch-ci would not catch this for us. I'll give my test status report here... $ gradle modules:reindex:integTest
...
=======================================
Elasticsearch Build Hamster says Hello!
=======================================
Gradle Version : 3.5
OS Info : Mac OS X 10.12.4 (x86_64)
JDK Version : Azul Systems, Inc. 1.8.0_131 [OpenJDK 64-Bit Server VM 25.131-b11]
JAVA_HOME : /Users/tal/.sdkman/candidates/java/8u131-zulu
Random Testing Seed : F9BFC07CD9E8FFD6
The executable property on ForkOptions has been deprecated and is scheduled to be removed in Gradle 5.0. Please use javaHome instead.
...
==> Test Info: seed=90419E107D08AA73; jvm=1; suite=1
==> Test Summary: 1 suite, 119 tests
:modules:reindex:integTestCluster#stop
:modules:reindex:integTest
BUILD SUCCESSFUL🍏 📗 💚 🥗 Intellij & Eclipse not reflected here |
|
I can't comment to the approach taken but this works for me on both 3.5 and 4.0.1. It also fixed my intellij 2017.2 that decided to break this morning. |
|
++ lets merge this |
|
@hub-cap the fix worked on 3.4.1, but now I am experiencing issues with |
The configuration removed from the runtime configuration did not properly remove the deps jar from gradle versions > 3.3. The rest client now removes both the 3.3 and 3.3+ configurations so this works on both versions of gradle. Closes elastic#25884 Relates elastic#25208
|
Facepalm. Let's pretend we didn't just commit a misleading msg to git forever :D |
|
Oh, I did not know that force push is not allowed... |
The configuration removed from the runtime configuration did not
properly remove the deps jar from gradle versions > 3.3. The rest client
now removes both the 3.3 and 3.3+ configurations so this works on both
versions of gradle.
Closes #25884
Relates #25208