From 56e4c66d1fff4713956f6ed895adf44cdfa7884c Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 15 Nov 2017 15:33:25 -0500 Subject: [PATCH] SQL: Fix IDE build after shading (elastic/x-pack-elasticsearch#3026) The IDEs don't participate in the shading but gradle does. So we have to be a little more tricky about how we set up the IDE projects, sadly. Original commit: elastic/x-pack-elasticsearch@5196756702810907235a7533266b74113aa69c54 --- qa/sql/build.gradle | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/qa/sql/build.gradle b/qa/sql/build.gradle index 6f241c14981..eb045d05899 100644 --- a/qa/sql/build.gradle +++ b/qa/sql/build.gradle @@ -8,16 +8,17 @@ dependencies { compile "org.elasticsearch.test:framework:${versions.elasticsearch}" // JDBC testing dependencies - compile(project(path: ':x-pack-elasticsearch:sql:jdbc', configuration: 'shadow')) { - if (false == isEclipse && false == isIdea) { - /* Skip the transitive dependencies of the server when outside - * of an IDE because outside of an IDE we use the jdbc jar - * which includes all the transitive dependencies *already*. - * If we didn't skip these dependencies the jar hell checks - * would fail. And we need the transitive dependencies to - * run in embedded mode but only do that inside of an IDE. */ - transitive = false - } + if (false == isEclipse && false == isIdea) { + // If we're not doing IDE stuff use the shadowed jar + compile(project(path: ':x-pack-elasticsearch:sql:jdbc', configuration: 'shadow')) + } else { + /* If we're doing IDE stuff then use then use the project + * dependency so the IDEs don't get confused. Transitive + * deps are OK here too because this is the only time we + * pull all of those deps in. We make sure exclude them + * below so they don't cause jar hell with the shadowed + * jar. */ + compile(project(':x-pack-elasticsearch:sql:jdbc')) } compile "net.sourceforge.csvjdbc:csvjdbc:1.0.34" runtime "com.h2database:h2:1.4.194"