diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b8f4262ca5c..8ee03c3d999 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -214,7 +214,7 @@ If your changes affect only the documentation, run:
```sh
./gradlew -p docs check
```
-For more information about testing code examples in the documentation, see
+For more information about testing code examples in the documentation, see
https://github.com/elastic/elasticsearch/blob/master/docs/README.asciidoc
### Project layout
@@ -305,6 +305,39 @@ the `qa` subdirectory functions just like the top level `qa` subdirectory. The
Elasticsearch process. The `transport-client` subdirectory contains extensions
to Elasticsearch's standard transport client to work properly with x-pack.
+### Gradle Build
+
+We use Gradle to build Elasticsearch because it is flexible enough to not only
+build and package Elasticsearch, but also orchestrate all of the ways that we
+have to test Elasticsearch.
+
+#### Configurations
+
+Gradle organizes dependencies and build artifacts into "configurations" and
+allows you to use these configurations arbitrarilly. Here are some of the most
+common configurations in our build and how we use them:
+
+
+- `compile`
- Code that is on the classpath at both compile and
+runtime. If the [`shadow`][shadow-plugin] plugin is applied to the project then
+this code is bundled into the jar produced by the project.
+- `runtime`
- Code that is not on the classpath at compile time but is
+on the classpath at runtime. We mostly use this configuration to make sure that
+we do not accidentally compile against dependencies of our dependencies also
+known as "transitive" dependencies".
+- `compileOnly`
- Code that is on the classpath at comile time but that
+should not be shipped with the project because it is "provided" by the runtime
+somehow. Elasticsearch plugins use this configuration to include dependencies
+that are bundled with Elasticsearch's server.
+- `shadow`
- Only available in projects with the shadow plugin. Code
+that is on the classpath at both compile and runtime but it *not* bundled into
+the jar produced by the project. If you depend on a project with the `shadow`
+plugin then you need to depend on this configuration because it will bring
+along all of the dependencies you need at runtime.
+- `testCompile`
- Code that is on the classpath for compiling tests
+that are part of this project but not production code. The canonical example
+of this is `junit`.
+
Contributing as part of a class
-------------------------------
@@ -337,3 +370,4 @@ repeating in this section because it has come up in this context.
[eclipse]: http://www.eclipse.org/community/eclipse_newsletter/2017/june/
[intellij]: https://blog.jetbrains.com/idea/2017/07/intellij-idea-2017-2-is-here-smart-sleek-and-snappy/
+[shadow-plugin]: https://github.com/johnrengelman/shadow
diff --git a/build.gradle b/build.gradle
index 66f34d8f445..8df89cb064c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -516,6 +516,31 @@ allprojects {
tasks.eclipse.dependsOn(cleanEclipse, copyEclipseSettings)
}
+allprojects {
+ /*
+ * IntelliJ and Eclipse don't know about the shadow plugin so when we're
+ * in "IntelliJ mode" or "Eclipse mode" add "runtime" dependencies
+ * eveywhere where we see a "shadow" dependency which will cause them to
+ * reference shadowed projects directly rather than rely on the shadowing
+ * to include them. This is the correct thing for it to do because it
+ * doesn't run the jar shadowing at all. This isn't needed for the project
+ * itself because the IDE configuration is done by SourceSets but it is
+ * *is* needed for projects that depends on the project doing the shadowing.
+ * Without this they won't properly depend on the shadowed project.
+ */
+ if (isEclipse || isIdea) {
+ configurations.all { Configuration configuration ->
+ dependencies.all { Dependency dep ->
+ if (dep instanceof ProjectDependency) {
+ if (dep.getTargetConfiguration() == 'shadow') {
+ configuration.dependencies.add(project.dependencies.project(path: dep.dependencyProject.path, configuration: 'runtime'))
+ }
+ }
+ }
+ }
+ }
+}
+
// we need to add the same --debug-jvm option as
// the real RunTask has, so we can pass it through
class Run extends DefaultTask {
diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy
index 85216cf7336..94a8bf26177 100644
--- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy
@@ -391,6 +391,9 @@ class BuildPlugin implements Plugin {
project.configurations.compile.dependencies.all(disableTransitiveDeps)
project.configurations.testCompile.dependencies.all(disableTransitiveDeps)
project.configurations.compileOnly.dependencies.all(disableTransitiveDeps)
+ project.plugins.withType(ShadowPlugin).whenPluginAdded {
+ project.configurations.shadow.dependencies.all(disableTransitiveDeps)
+ }
}
/** Adds repositories used by ES dependencies */
@@ -882,11 +885,20 @@ class BuildPlugin implements Plugin {
project.dependencyLicenses.dependencies = project.configurations.runtime.fileCollection {
it.group.startsWith('org.elasticsearch') == false
} - project.configurations.compileOnly
+ project.plugins.withType(ShadowPlugin).whenPluginAdded {
+ project.dependencyLicenses.dependencies += project.configurations.shadow.fileCollection {
+ it.group.startsWith('org.elasticsearch') == false
+ }
+ }
}
private static configureDependenciesInfo(Project project) {
Task deps = project.tasks.create("dependenciesInfo", DependenciesInfoTask.class)
deps.runtimeConfiguration = project.configurations.runtime
+ project.plugins.withType(ShadowPlugin).whenPluginAdded {
+ deps.runtimeConfiguration = project.configurations.create('infoDeps')
+ deps.runtimeConfiguration.extendsFrom(project.configurations.runtime, project.configurations.shadow)
+ }
deps.compileOnlyConfiguration = project.configurations.compileOnly
project.afterEvaluate {
deps.mappings = project.dependencyLicenses.mappings
diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy
index 7f6f337e8a9..00f178fda9c 100644
--- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy
@@ -48,18 +48,6 @@ public class PluginBuildPlugin extends BuildPlugin {
@Override
public void apply(Project project) {
super.apply(project)
- project.plugins.withType(ShadowPlugin).whenPluginAdded {
- /*
- * We've not tested these plugins together and we're fairly sure
- * they aren't going to work properly as is *and* we're not really
- * sure *why* you'd want to shade stuff in plugins. So we throw an
- * exception here to make you come and read this comment. If you
- * have a need for shadow while building plugins then know that you
- * are probably going to have to fight with gradle for a while....
- */
- throw new InvalidUserDataException('elasticsearch.esplugin is not '
- + 'compatible with com.github.johnrengelman.shadow');
- }
configureDependencies(project)
// this afterEvaluate must happen before the afterEvaluate added by integTest creation,
// so that the file name resolution for installing the plugin will be setup
@@ -153,8 +141,13 @@ public class PluginBuildPlugin extends BuildPlugin {
include(buildProperties.descriptorOutput.name)
}
from pluginMetadata // metadata (eg custom security policy)
- from project.jar // this plugin's jar
- from project.configurations.runtime - project.configurations.compileOnly // the dep jars
+ /*
+ * If the plugin is using the shadow plugin then we need to bundle
+ * "shadow" things rather than the default jar and dependencies so
+ * we don't hit jar hell.
+ */
+ from { project.plugins.hasPlugin(ShadowPlugin) ? project.shadowJar : project.jar }
+ from { project.plugins.hasPlugin(ShadowPlugin) ? project.configurations.shadow : project.configurations.runtime - project.configurations.compileOnly }
// extra files for the plugin to go into the zip
from('src/main/packaging') // TODO: move all config/bin/_size/etc into packaging
from('src/main') {
diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle
index 4176cdeb0b7..2ae26044be5 100644
--- a/x-pack/docs/build.gradle
+++ b/x-pack/docs/build.gradle
@@ -30,7 +30,7 @@ buildRestTests.expectedUnconvertedCandidates = [
]
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
}
@@ -264,7 +264,7 @@ setups['farequote_index'] = '''
airline:
type: keyword
doc_count:
- type: integer
+ type: integer
'''
setups['farequote_data'] = setups['farequote_index'] + '''
- do:
@@ -277,7 +277,7 @@ setups['farequote_data'] = setups['farequote_index'] + '''
{"airline":"JZA","responsetime":990.4628,"time":"2016-02-07T00:00:00+0000", "doc_count": 5}
{"index": {"_id":"2"}}
{"airline":"JBU","responsetime":877.5927,"time":"2016-02-07T00:00:00+0000", "doc_count": 23}
- {"index": {"_id":"3"}}
+ {"index": {"_id":"3"}}
{"airline":"KLM","responsetime":1355.4812,"time":"2016-02-07T00:00:00+0000", "doc_count": 42}
'''
setups['farequote_job'] = setups['farequote_data'] + '''
@@ -309,7 +309,7 @@ setups['farequote_datafeed'] = setups['farequote_job'] + '''
"job_id":"farequote",
"indexes":"farequote"
}
-'''
+'''
setups['server_metrics_index'] = '''
- do:
indices.create:
diff --git a/x-pack/license-tools/build.gradle b/x-pack/license-tools/build.gradle
index 3ef08073bbf..183b9ab50e0 100644
--- a/x-pack/license-tools/build.gradle
+++ b/x-pack/license-tools/build.gradle
@@ -1,7 +1,7 @@
apply plugin: 'elasticsearch.build'
dependencies {
- compile project(xpackModule('core'))
+ compile project(path: xpackModule('core'), configuration: 'shadow')
compile "org.elasticsearch:elasticsearch:${version}"
testCompile "org.elasticsearch.test:framework:${version}"
}
@@ -17,7 +17,7 @@ task buildZip(type: Zip, dependsOn: jar) {
into(parentDir + '/lib') {
from jar
from configurations.runtime
- }
+ }
into(parentDir + '/bin') {
from 'bin'
}
diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle
index 7ed98ccb5b4..b498246391d 100644
--- a/x-pack/plugin/core/build.gradle
+++ b/x-pack/plugin/core/build.gradle
@@ -8,6 +8,7 @@ import java.nio.file.StandardCopyOption
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'
+apply plugin: 'com.github.johnrengelman.shadow'
archivesBaseName = 'x-pack-core'
@@ -27,17 +28,17 @@ dependencyLicenses {
dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
compile project(':x-pack:protocol')
- compile "org.apache.httpcomponents:httpclient:${versions.httpclient}"
- compile "org.apache.httpcomponents:httpcore:${versions.httpcore}"
- compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}"
- compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}"
+ shadow "org.apache.httpcomponents:httpclient:${versions.httpclient}"
+ shadow "org.apache.httpcomponents:httpcore:${versions.httpcore}"
+ shadow "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}"
+ shadow "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}"
- compile "commons-logging:commons-logging:${versions.commonslogging}"
- compile "commons-codec:commons-codec:${versions.commonscodec}"
+ shadow "commons-logging:commons-logging:${versions.commonslogging}"
+ shadow "commons-codec:commons-codec:${versions.commonscodec}"
// security deps
- compile 'com.unboundid:unboundid-ldapsdk:3.2.0'
- compile project(path: ':modules:transport-netty4', configuration: 'runtime')
+ shadow 'com.unboundid:unboundid-ldapsdk:3.2.0'
+ shadow project(path: ':modules:transport-netty4', configuration: 'runtime')
testCompile 'org.elasticsearch:securemock:1.2'
testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}"
@@ -107,7 +108,8 @@ test {
// TODO: don't publish test artifacts just to run messy tests, fix the tests!
// https://github.com/elastic/x-plugins/issues/724
configurations {
- testArtifacts.extendsFrom testRuntime
+ testArtifacts.extendsFrom(testRuntime, shadow)
+ testArtifacts.exclude(group: project(':x-pack:protocol').group, module: project(':x-pack:protocol').name)
}
task testJar(type: Jar) {
appendix 'test'
diff --git a/x-pack/plugin/deprecation/build.gradle b/x-pack/plugin/deprecation/build.gradle
index d89eb62e884..3746287d615 100644
--- a/x-pack/plugin/deprecation/build.gradle
+++ b/x-pack/plugin/deprecation/build.gradle
@@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-deprecation'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
}
run {
diff --git a/x-pack/plugin/graph/build.gradle b/x-pack/plugin/graph/build.gradle
index 3ddd2ebee04..2b0f592b720 100644
--- a/x-pack/plugin/graph/build.gradle
+++ b/x-pack/plugin/graph/build.gradle
@@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-graph'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
diff --git a/x-pack/plugin/logstash/build.gradle b/x-pack/plugin/logstash/build.gradle
index 5a9b5d6cbe5..2e158a90ac7 100644
--- a/x-pack/plugin/logstash/build.gradle
+++ b/x-pack/plugin/logstash/build.gradle
@@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-logstash'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle
index 4c3cc9eef93..a6730161337 100644
--- a/x-pack/plugin/ml/build.gradle
+++ b/x-pack/plugin/ml/build.gradle
@@ -40,7 +40,7 @@ compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// This should not be here
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle
index 3fde6cd8c37..a452ef09a20 100644
--- a/x-pack/plugin/monitoring/build.gradle
+++ b/x-pack/plugin/monitoring/build.gradle
@@ -13,7 +13,7 @@ esplugin {
archivesBaseName = 'x-pack-monitoring'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// monitoring deps
@@ -66,7 +66,7 @@ task internalClusterTest(type: RandomizedTestingTask,
include '**/*IT.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false'
}
-check.dependsOn internalClusterTest
+check.dependsOn internalClusterTest
internalClusterTest.mustRunAfter test
// also add an "alias" task to make typing on the command line easier task icTest {
diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle
index ff9c30ed9a9..649a89bc2cd 100644
--- a/x-pack/plugin/rollup/build.gradle
+++ b/x-pack/plugin/rollup/build.gradle
@@ -16,7 +16,7 @@ compileTestJava.options.compilerArgs << "-Xlint:-rawtypes"
dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle
index 4b17bd47812..6db533bbecf 100644
--- a/x-pack/plugin/security/build.gradle
+++ b/x-pack/plugin/security/build.gradle
@@ -12,7 +12,7 @@ esplugin {
archivesBaseName = 'x-pack-security'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime')
compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime')
diff --git a/x-pack/plugin/security/cli/build.gradle b/x-pack/plugin/security/cli/build.gradle
index 1799a2c7b81..19b86dd91c7 100644
--- a/x-pack/plugin/security/cli/build.gradle
+++ b/x-pack/plugin/security/cli/build.gradle
@@ -4,7 +4,7 @@ archivesBaseName = 'elasticsearch-security-cli'
dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
- compileOnly xpackProject('plugin:core')
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
compile 'org.bouncycastle:bcprov-jdk15on:1.59'
compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
testImplementation 'com.google.jimfs:jimfs:1.1'
@@ -17,4 +17,4 @@ dependencies {
dependencyLicenses {
mapping from: /bc.*/, to: 'bouncycastle'
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle
index 436837e85b4..039e78c1495 100644
--- a/x-pack/plugin/sql/build.gradle
+++ b/x-pack/plugin/sql/build.gradle
@@ -19,7 +19,7 @@ archivesBaseName = 'x-pack-sql'
integTest.enabled = false
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
compileOnly(project(':modules:lang-painless')) {
// exclude ASM to not affect featureAware task on Java 10+
exclude group: "org.ow2.asm"
diff --git a/x-pack/plugin/upgrade/build.gradle b/x-pack/plugin/upgrade/build.gradle
index 8e65f87da30..f95cde7134c 100644
--- a/x-pack/plugin/upgrade/build.gradle
+++ b/x-pack/plugin/upgrade/build.gradle
@@ -14,7 +14,7 @@ esplugin {
archivesBaseName = 'x-pack-upgrade'
dependencies {
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
@@ -39,7 +39,7 @@ task internalClusterTest(type: RandomizedTestingTask,
include '**/*IT.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false'
}
-check.dependsOn internalClusterTest
+check.dependsOn internalClusterTest
internalClusterTest.mustRunAfter test
// also add an "alias" task to make typing on the command line easier
diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle
index 2b7b73d3796..a0feab67463 100644
--- a/x-pack/plugin/watcher/build.gradle
+++ b/x-pack/plugin/watcher/build.gradle
@@ -25,7 +25,7 @@ dependencyLicenses {
dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}"
- compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime')
compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime')
diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle
index 5a6f0c9cc83..3cf29701206 100644
--- a/x-pack/qa/full-cluster-restart/build.gradle
+++ b/x-pack/qa/full-cluster-restart/build.gradle
@@ -11,7 +11,7 @@ apply plugin: 'elasticsearch.build'
test.enabled = false
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile (project(path: xpackModule('security'), configuration: 'runtime')) {
// Need to drop the guava dependency here or we get a conflict with watcher's guava dependency.
// This is total #$%, but the solution is to get the SAML realm (which uses guava) out of security proper
@@ -249,7 +249,7 @@ subprojects {
check.dependsOn(integTest)
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
diff --git a/x-pack/qa/ml-basic-multi-node/build.gradle b/x-pack/qa/ml-basic-multi-node/build.gradle
index d396d38b223..3df77aadccb 100644
--- a/x-pack/qa/ml-basic-multi-node/build.gradle
+++ b/x-pack/qa/ml-basic-multi-node/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
diff --git a/x-pack/qa/ml-disabled/build.gradle b/x-pack/qa/ml-disabled/build.gradle
index 22a7dfc74ac..e914def3507 100644
--- a/x-pack/qa/ml-disabled/build.gradle
+++ b/x-pack/qa/ml-disabled/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
diff --git a/x-pack/qa/ml-native-multi-node-tests/build.gradle b/x-pack/qa/ml-native-multi-node-tests/build.gradle
index b8627db3068..b1893b20c46 100644
--- a/x-pack/qa/ml-native-multi-node-tests/build.gradle
+++ b/x-pack/qa/ml-native-multi-node-tests/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts')
diff --git a/x-pack/qa/ml-no-bootstrap-tests/build.gradle b/x-pack/qa/ml-no-bootstrap-tests/build.gradle
index cad5201a67b..7e252afa302 100644
--- a/x-pack/qa/ml-no-bootstrap-tests/build.gradle
+++ b/x-pack/qa/ml-no-bootstrap-tests/build.gradle
@@ -1,7 +1,6 @@
apply plugin: 'elasticsearch.standalone-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
-
diff --git a/x-pack/qa/ml-single-node-tests/build.gradle b/x-pack/qa/ml-single-node-tests/build.gradle
index 9fd4a8d44d2..b62e37894b3 100644
--- a/x-pack/qa/ml-single-node-tests/build.gradle
+++ b/x-pack/qa/ml-single-node-tests/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
diff --git a/x-pack/qa/multi-cluster-search-security/build.gradle b/x-pack/qa/multi-cluster-search-security/build.gradle
index f5265466965..5d90f974762 100644
--- a/x-pack/qa/multi-cluster-search-security/build.gradle
+++ b/x-pack/qa/multi-cluster-search-security/build.gradle
@@ -3,7 +3,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask
apply plugin: 'elasticsearch.standalone-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
diff --git a/x-pack/qa/multi-node/build.gradle b/x-pack/qa/multi-node/build.gradle
index 69c7a696ff0..19729cf367e 100644
--- a/x-pack/qa/multi-node/build.gradle
+++ b/x-pack/qa/multi-node/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
integTestCluster {
diff --git a/x-pack/qa/openldap-tests/build.gradle b/x-pack/qa/openldap-tests/build.gradle
index 5c0399a1d9f..24cd6184afa 100644
--- a/x-pack/qa/openldap-tests/build.gradle
+++ b/x-pack/qa/openldap-tests/build.gradle
@@ -5,7 +5,7 @@ apply plugin: 'elasticsearch.standalone-test'
apply plugin: 'elasticsearch.vagrantsupport'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
@@ -32,4 +32,3 @@ namingConventions {
// integ tests use Tests instead of IT
skipIntegTestInDisguise = true
}
-
diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle
index ddf72f7d458..097d343b279 100644
--- a/x-pack/qa/reindex-tests-with-security/build.gradle
+++ b/x-pack/qa/reindex-tests-with-security/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:reindex')
diff --git a/x-pack/qa/rolling-upgrade-basic/build.gradle b/x-pack/qa/rolling-upgrade-basic/build.gradle
index 6d5b250b460..21ac4414d86 100644
--- a/x-pack/qa/rolling-upgrade-basic/build.gradle
+++ b/x-pack/qa/rolling-upgrade-basic/build.gradle
@@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets
apply plugin: 'elasticsearch.standalone-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit
}
diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle
index f60cbe4b34c..b983caa8669 100644
--- a/x-pack/qa/rolling-upgrade/build.gradle
+++ b/x-pack/qa/rolling-upgrade/build.gradle
@@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.build'
test.enabled = false
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit
}
@@ -284,7 +284,7 @@ subprojects {
check.dependsOn(integTest)
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('watcher'))
}
diff --git a/x-pack/qa/saml-idp-tests/build.gradle b/x-pack/qa/saml-idp-tests/build.gradle
index ebb0d88991f..752ec6fb307 100644
--- a/x-pack/qa/saml-idp-tests/build.gradle
+++ b/x-pack/qa/saml-idp-tests/build.gradle
@@ -6,7 +6,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile 'com.google.jimfs:jimfs:1.1'
@@ -84,4 +84,3 @@ thirdPartyAudit.excludes = [
// missing
'com.ibm.icu.lang.UCharacter'
]
-
diff --git a/x-pack/qa/security-client-tests/build.gradle b/x-pack/qa/security-client-tests/build.gradle
index 4e517f4d363..97945fb00ef 100644
--- a/x-pack/qa/security-client-tests/build.gradle
+++ b/x-pack/qa/security-client-tests/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
diff --git a/x-pack/qa/security-example-spi-extension/build.gradle b/x-pack/qa/security-example-spi-extension/build.gradle
index b2fac075cb3..7aeed3ad62d 100644
--- a/x-pack/qa/security-example-spi-extension/build.gradle
+++ b/x-pack/qa/security-example-spi-extension/build.gradle
@@ -8,7 +8,7 @@ esplugin {
}
dependencies {
- compileOnly project(path: xpackModule('core'), configuration: 'runtime')
+ compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
diff --git a/x-pack/qa/security-migrate-tests/build.gradle b/x-pack/qa/security-migrate-tests/build.gradle
index 7ccf6d2349b..3a8a0cf1005 100644
--- a/x-pack/qa/security-migrate-tests/build.gradle
+++ b/x-pack/qa/security-migrate-tests/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
diff --git a/x-pack/qa/security-setup-password-tests/build.gradle b/x-pack/qa/security-setup-password-tests/build.gradle
index 16accc87a94..adb159acf6f 100644
--- a/x-pack/qa/security-setup-password-tests/build.gradle
+++ b/x-pack/qa/security-setup-password-tests/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
diff --git a/x-pack/qa/smoke-test-graph-with-security/build.gradle b/x-pack/qa/smoke-test-graph-with-security/build.gradle
index d3f788d0b06..9cdfaffccfb 100644
--- a/x-pack/qa/smoke-test-graph-with-security/build.gradle
+++ b/x-pack/qa/smoke-test-graph-with-security/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
// bring in graph rest test suite
diff --git a/x-pack/qa/smoke-test-ml-with-security/build.gradle b/x-pack/qa/smoke-test-ml-with-security/build.gradle
index 2a12aa2f28d..84c23add254 100644
--- a/x-pack/qa/smoke-test-ml-with-security/build.gradle
+++ b/x-pack/qa/smoke-test-ml-with-security/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
}
diff --git a/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle b/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle
index 4e079430562..8ce0cde7657 100644
--- a/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle
+++ b/x-pack/qa/smoke-test-monitoring-with-watcher/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'))
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'))
testCompile project(path: xpackModule('monitoring'))
}
@@ -24,4 +24,3 @@ integTestCluster {
// one of the exporters should configure cluster alerts
// setting 'xpack.monitoring.exporters.my_http.cluster_alerts.management.enabled', 'true'
}
-
diff --git a/x-pack/qa/smoke-test-plugins-ssl/build.gradle b/x-pack/qa/smoke-test-plugins-ssl/build.gradle
index 672bc3a19e8..53533bd9b87 100644
--- a/x-pack/qa/smoke-test-plugins-ssl/build.gradle
+++ b/x-pack/qa/smoke-test-plugins-ssl/build.gradle
@@ -15,7 +15,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
String outputDir = "${buildDir}/generated-resources/${project.name}"
diff --git a/x-pack/qa/smoke-test-plugins/build.gradle b/x-pack/qa/smoke-test-plugins/build.gradle
index 4badc9d3509..b66903af18b 100644
--- a/x-pack/qa/smoke-test-plugins/build.gradle
+++ b/x-pack/qa/smoke-test-plugins/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
ext.pluginsCount = 0
diff --git a/x-pack/qa/smoke-test-security-with-mustache/build.gradle b/x-pack/qa/smoke-test-security-with-mustache/build.gradle
index 1c43db0b63e..d921c5f5b66 100644
--- a/x-pack/qa/smoke-test-security-with-mustache/build.gradle
+++ b/x-pack/qa/smoke-test-security-with-mustache/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
}
diff --git a/x-pack/qa/smoke-test-watcher-with-security/build.gradle b/x-pack/qa/smoke-test-watcher-with-security/build.gradle
index 0f052074bfb..a843641be80 100644
--- a/x-pack/qa/smoke-test-watcher-with-security/build.gradle
+++ b/x-pack/qa/smoke-test-watcher-with-security/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
// bring in watcher rest test suite
diff --git a/x-pack/qa/smoke-test-watcher/build.gradle b/x-pack/qa/smoke-test-watcher/build.gradle
index abfd27e729b..dc87248df61 100644
--- a/x-pack/qa/smoke-test-watcher/build.gradle
+++ b/x-pack/qa/smoke-test-watcher/build.gradle
@@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
testCompile project(path: ':modules:lang-painless', configuration: 'runtime')
diff --git a/x-pack/qa/sql/security/build.gradle b/x-pack/qa/sql/security/build.gradle
index 15f7734f942..f02886f80a1 100644
--- a/x-pack/qa/sql/security/build.gradle
+++ b/x-pack/qa/sql/security/build.gradle
@@ -1,5 +1,5 @@
dependencies {
- testCompile "org.elasticsearch.plugin:x-pack-core:${version}"
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
Project mainProject = project
@@ -20,7 +20,7 @@ subprojects {
}
dependencies {
- testCompile "org.elasticsearch.plugin:x-pack-core:${version}"
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
}
integTestCluster {
diff --git a/x-pack/qa/third-party/hipchat/build.gradle b/x-pack/qa/third-party/hipchat/build.gradle
index cd37d6e738e..03b6c319698 100644
--- a/x-pack/qa/third-party/hipchat/build.gradle
+++ b/x-pack/qa/third-party/hipchat/build.gradle
@@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
}
diff --git a/x-pack/qa/third-party/jira/build.gradle b/x-pack/qa/third-party/jira/build.gradle
index 078fed4dd36..3814c8e9a53 100644
--- a/x-pack/qa/third-party/jira/build.gradle
+++ b/x-pack/qa/third-party/jira/build.gradle
@@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
}
diff --git a/x-pack/qa/third-party/pagerduty/build.gradle b/x-pack/qa/third-party/pagerduty/build.gradle
index 683e18caa1c..c0f337e160e 100644
--- a/x-pack/qa/third-party/pagerduty/build.gradle
+++ b/x-pack/qa/third-party/pagerduty/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
}
diff --git a/x-pack/qa/third-party/slack/build.gradle b/x-pack/qa/third-party/slack/build.gradle
index abcdad0e096..431752765f3 100644
--- a/x-pack/qa/third-party/slack/build.gradle
+++ b/x-pack/qa/third-party/slack/build.gradle
@@ -5,7 +5,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
}
diff --git a/x-pack/qa/transport-client-tests/build.gradle b/x-pack/qa/transport-client-tests/build.gradle
index c864a9084cb..a94ad8fd592 100644
--- a/x-pack/qa/transport-client-tests/build.gradle
+++ b/x-pack/qa/transport-client-tests/build.gradle
@@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
- testCompile project(path: xpackModule('core'), configuration: 'runtime')
+ testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
diff --git a/x-pack/test/feature-aware/build.gradle b/x-pack/test/feature-aware/build.gradle
index 11b0e67183c..f6a1f6cb16f 100644
--- a/x-pack/test/feature-aware/build.gradle
+++ b/x-pack/test/feature-aware/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'elasticsearch.build'
dependencies {
compile 'org.ow2.asm:asm:6.2'
compile "org.elasticsearch:elasticsearch:${version}"
- compile "org.elasticsearch.plugin:x-pack-core:${version}"
+ compile project(path: xpackModule('core'), configuration: 'shadow')
testCompile "org.elasticsearch.test:framework:${version}"
}
diff --git a/x-pack/transport-client/build.gradle b/x-pack/transport-client/build.gradle
index 31c05569274..7155dad5ee6 100644
--- a/x-pack/transport-client/build.gradle
+++ b/x-pack/transport-client/build.gradle
@@ -9,8 +9,8 @@ archivesBaseName = 'x-pack-transport'
dependencies {
// this "api" dependency looks weird, but it is correct, as it contains
- // all of x-pack for now, and transport client will be going away in the future.
- compile "org.elasticsearch.plugin:x-pack-core:${version}"
+ // all of x-pack for now, and transport client will be going away in the future.
+ compile project(path: xpackModule('core'), configuration: 'shadow')
compile "org.elasticsearch.client:transport:${version}"
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testCompile "junit:junit:${versions.junit}"