Fix eclipse issues related to rest client shading#25874
Fix eclipse issues related to rest client shading#25874hub-cap merged 2 commits intoelastic:masterfrom
Conversation
* A cycle was detected in eclipse, and was fixed in the same fashion as core and core-tests. * The rest client deps jar was not properly exported in the generated eclipse classpath file for rest client. * Moved the plugin dependency due to eclipse-build 'apply from' not liking the plugin declaration in the rest client build. Relates elastic#25208
|
@nik9000 just an fyi, there is still a single problem in the eclipse build, but its totally unrelated to (or at least I think) the changes in the rest client. |
rjernst
left a comment
There was a problem hiding this comment.
LGTM, just a question on why we need the shadow plugin in buildSrc
buildSrc/build.gradle
Outdated
| compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE.... | ||
| compile 'de.thetaphi:forbiddenapis:2.3' | ||
| compile 'org.apache.rat:apache-rat:0.11' | ||
| compile 'com.github.jengelman.gradle.plugins:shadow:2.0.1' |
There was a problem hiding this comment.
Why is this needed? Nothing in buildSrc uses it right?
| * `org.elasticsearch.client`. This jar is the only actual output artifact of this job. | ||
| */ | ||
| plugins { | ||
| id "com.github.johnrengelman.shadow" version "2.0.1" |
There was a problem hiding this comment.
Why are you moving this to the "apply plugin" form?
|
Just for information, I have tested this on "Eclipse Neon.3 Release (4.6.3)" and can confirm it fixes the dependency cycle leaving no issues in Eclipse. This test was done on both master and 6.x branches |
|
I also tested master on "Eclipse Oxygen Release (4.7.0)" and the dependency cycle issue is fixed but I get the following error: I assume this is the error that @hub-cap is referring to above. These kinds of generics issues are common in eclipse unfortunately and seems unrelated to the issue this PR is fixing |
We tend to push Eclipse's compiler quite a bit, yeah. I've been filing issues with them as we encounter the issues and working around them and leaving a comment linking to the issue. |
| sourceSets { | ||
| if (project.path == ":client:rest") { | ||
| main.java.srcDirs = ['java'] | ||
| //main.resources.srcDirs = ['resources'] |
There was a problem hiding this comment.
I'd either uncomment or remove this line entirely.
|
I tested locally and this fixes my issue. |
|
I thought I was crazy for a moment, but this indeed (with that reverted second commit) blows up when doing anything eclipse related. I will attempt to use the buildscript style. https://docs.gradle.org/3.3/userguide/plugins.html#plugins_dsl_limitations |
|
2c271f0 fixes the last comment I made. |
* A cycle was detected in eclipse, and was fixed in the same fashion as core and core-tests. * The rest client deps jar was not properly exported in the generated eclipse classpath file for rest client. Relates #25208
* A cycle was detected in eclipse, and was fixed in the same fashion as core and core-tests. * The rest client deps jar was not properly exported in the generated eclipse classpath file for rest client. Relates #25208
* A cycle was detected in eclipse, and was fixed in the same fashion as core and core-tests. * The rest client deps jar was not properly exported in the generated eclipse classpath file for rest client. Relates #25208
core and core-tests.
eclipse classpath file for rest client.
liking the plugin declaration in the rest client build.
Relates #25208