Build: Shadow x-pack:protocol into x-pack:plugin:core (#32240)

This bundles the x-pack:protocol project into the x-pack:plugin:core
project because we'd like folks to consider it an implementation detail
of our build rather than a separate artifact to be managed and depended
on. It is now bundled into both x-pack:plugin:core and
client:rest-high-level. To make this work I had to fix a few things.

Firstly, I had to make PluginBuildPlugin work with the shadow plugin.
In that case we have to bundle only the `shadow` dependencies and the
shadow jar.

Secondly, every reference to x-pack:plugin:core has to use the `shadow`
configuration. Without that the reference is missing all of the
un-shadowed dependencies. I tried to make it so that applying the shadow
plugin automatically redefines the `default` configuration to mirror the
`shadow` configuration which would allow us to use bare project references
to the x-pack:plugin:core project but I couldn't make it work. It'd *look*
like it works but then fail for transitive dependencies anyway. I think
it is still a good thing to do but I don't have the willpower to do it
now.

Finally, I had to fix an issue where Eclipse and IntelliJ didn't properly
reference shadowed transitive dependencies. Neither IDE supports shadowing
natively so they have to reference the shadowed projects. We fix this by
detecting `shadow` dependencies when in "Intellij mode" or "Eclipse mode"
and adding `runtime` dependencies to the same target. This convinces
IntelliJ and Eclipse to play nice.
This commit is contained in:
Nik Everett 2018-07-24 11:53:04 -04:00 committed by GitHub
parent a525c36c60
commit e6b9f59e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 147 additions and 85 deletions

View File

@ -214,7 +214,7 @@ If your changes affect only the documentation, run:
```sh ```sh
./gradlew -p docs check ./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 https://github.com/elastic/elasticsearch/blob/master/docs/README.asciidoc
### Project layout ### 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 Elasticsearch process. The `transport-client` subdirectory contains extensions
to Elasticsearch's standard transport client to work properly with x-pack. 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:
<dl>
<dt>`compile`</dt><dd>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.</dd>
<dt>`runtime`</dt><dd>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".</dd>
<dt>`compileOnly`</dt><dd>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.</dd>
<dt>`shadow`</dt><dd>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.</dd>
<dt>`testCompile`</dt><dd>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`.</dd>
</dl>
Contributing as part of a class 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/ [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/ [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

View File

@ -516,6 +516,31 @@ allprojects {
tasks.eclipse.dependsOn(cleanEclipse, copyEclipseSettings) 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 // we need to add the same --debug-jvm option as
// the real RunTask has, so we can pass it through // the real RunTask has, so we can pass it through
class Run extends DefaultTask { class Run extends DefaultTask {

View File

@ -391,6 +391,9 @@ class BuildPlugin implements Plugin<Project> {
project.configurations.compile.dependencies.all(disableTransitiveDeps) project.configurations.compile.dependencies.all(disableTransitiveDeps)
project.configurations.testCompile.dependencies.all(disableTransitiveDeps) project.configurations.testCompile.dependencies.all(disableTransitiveDeps)
project.configurations.compileOnly.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 */ /** Adds repositories used by ES dependencies */
@ -882,11 +885,20 @@ class BuildPlugin implements Plugin<Project> {
project.dependencyLicenses.dependencies = project.configurations.runtime.fileCollection { project.dependencyLicenses.dependencies = project.configurations.runtime.fileCollection {
it.group.startsWith('org.elasticsearch') == false it.group.startsWith('org.elasticsearch') == false
} - project.configurations.compileOnly } - 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) { private static configureDependenciesInfo(Project project) {
Task deps = project.tasks.create("dependenciesInfo", DependenciesInfoTask.class) Task deps = project.tasks.create("dependenciesInfo", DependenciesInfoTask.class)
deps.runtimeConfiguration = project.configurations.runtime 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 deps.compileOnlyConfiguration = project.configurations.compileOnly
project.afterEvaluate { project.afterEvaluate {
deps.mappings = project.dependencyLicenses.mappings deps.mappings = project.dependencyLicenses.mappings

View File

@ -48,18 +48,6 @@ public class PluginBuildPlugin extends BuildPlugin {
@Override @Override
public void apply(Project project) { public void apply(Project project) {
super.apply(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) configureDependencies(project)
// this afterEvaluate must happen before the afterEvaluate added by integTest creation, // this afterEvaluate must happen before the afterEvaluate added by integTest creation,
// so that the file name resolution for installing the plugin will be setup // 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) include(buildProperties.descriptorOutput.name)
} }
from pluginMetadata // metadata (eg custom security policy) 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 // 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/packaging') // TODO: move all config/bin/_size/etc into packaging
from('src/main') { from('src/main') {

View File

@ -30,7 +30,7 @@ buildRestTests.expectedUnconvertedCandidates = [
] ]
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
} }
@ -264,7 +264,7 @@ setups['farequote_index'] = '''
airline: airline:
type: keyword type: keyword
doc_count: doc_count:
type: integer type: integer
''' '''
setups['farequote_data'] = setups['farequote_index'] + ''' setups['farequote_data'] = setups['farequote_index'] + '''
- do: - 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} {"airline":"JZA","responsetime":990.4628,"time":"2016-02-07T00:00:00+0000", "doc_count": 5}
{"index": {"_id":"2"}} {"index": {"_id":"2"}}
{"airline":"JBU","responsetime":877.5927,"time":"2016-02-07T00:00:00+0000", "doc_count": 23} {"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} {"airline":"KLM","responsetime":1355.4812,"time":"2016-02-07T00:00:00+0000", "doc_count": 42}
''' '''
setups['farequote_job'] = setups['farequote_data'] + ''' setups['farequote_job'] = setups['farequote_data'] + '''
@ -309,7 +309,7 @@ setups['farequote_datafeed'] = setups['farequote_job'] + '''
"job_id":"farequote", "job_id":"farequote",
"indexes":"farequote" "indexes":"farequote"
} }
''' '''
setups['server_metrics_index'] = ''' setups['server_metrics_index'] = '''
- do: - do:
indices.create: indices.create:

View File

@ -1,7 +1,7 @@
apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.build'
dependencies { dependencies {
compile project(xpackModule('core')) compile project(path: xpackModule('core'), configuration: 'shadow')
compile "org.elasticsearch:elasticsearch:${version}" compile "org.elasticsearch:elasticsearch:${version}"
testCompile "org.elasticsearch.test:framework:${version}" testCompile "org.elasticsearch.test:framework:${version}"
} }
@ -17,7 +17,7 @@ task buildZip(type: Zip, dependsOn: jar) {
into(parentDir + '/lib') { into(parentDir + '/lib') {
from jar from jar
from configurations.runtime from configurations.runtime
} }
into(parentDir + '/bin') { into(parentDir + '/bin') {
from 'bin' from 'bin'
} }

View File

@ -8,6 +8,7 @@ import java.nio.file.StandardCopyOption
apply plugin: 'elasticsearch.esplugin' apply plugin: 'elasticsearch.esplugin'
apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm' apply plugin: 'nebula.maven-scm'
apply plugin: 'com.github.johnrengelman.shadow'
archivesBaseName = 'x-pack-core' archivesBaseName = 'x-pack-core'
@ -27,17 +28,17 @@ dependencyLicenses {
dependencies { dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}" compileOnly "org.elasticsearch:elasticsearch:${version}"
compile project(':x-pack:protocol') compile project(':x-pack:protocol')
compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" shadow "org.apache.httpcomponents:httpclient:${versions.httpclient}"
compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" shadow "org.apache.httpcomponents:httpcore:${versions.httpcore}"
compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" shadow "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}"
compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}" shadow "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}"
compile "commons-logging:commons-logging:${versions.commonslogging}" shadow "commons-logging:commons-logging:${versions.commonslogging}"
compile "commons-codec:commons-codec:${versions.commonscodec}" shadow "commons-codec:commons-codec:${versions.commonscodec}"
// security deps // security deps
compile 'com.unboundid:unboundid-ldapsdk:3.2.0' shadow 'com.unboundid:unboundid-ldapsdk:3.2.0'
compile project(path: ':modules:transport-netty4', configuration: 'runtime') shadow project(path: ':modules:transport-netty4', configuration: 'runtime')
testCompile 'org.elasticsearch:securemock:1.2' testCompile 'org.elasticsearch:securemock:1.2'
testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}" 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! // TODO: don't publish test artifacts just to run messy tests, fix the tests!
// https://github.com/elastic/x-plugins/issues/724 // https://github.com/elastic/x-plugins/issues/724
configurations { 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) { task testJar(type: Jar) {
appendix 'test' appendix 'test'

View File

@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-deprecation' archivesBaseName = 'x-pack-deprecation'
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
} }
run { run {

View File

@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-graph' archivesBaseName = 'x-pack-graph'
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }

View File

@ -10,7 +10,7 @@ esplugin {
archivesBaseName = 'x-pack-logstash' archivesBaseName = 'x-pack-logstash'
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }

View File

@ -40,7 +40,7 @@ compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,
compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// This should not be here // This should not be here
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')

View File

@ -13,7 +13,7 @@ esplugin {
archivesBaseName = 'x-pack-monitoring' archivesBaseName = 'x-pack-monitoring'
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// monitoring deps // monitoring deps
@ -66,7 +66,7 @@ task internalClusterTest(type: RandomizedTestingTask,
include '**/*IT.class' include '**/*IT.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false' systemProperty 'es.set.netty.runtime.available.processors', 'false'
} }
check.dependsOn internalClusterTest check.dependsOn internalClusterTest
internalClusterTest.mustRunAfter test internalClusterTest.mustRunAfter test
// also add an "alias" task to make typing on the command line easier task icTest { // also add an "alias" task to make typing on the command line easier task icTest {

View File

@ -16,7 +16,7 @@ compileTestJava.options.compilerArgs << "-Xlint:-rawtypes"
dependencies { dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}" 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') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }

View File

@ -12,7 +12,7 @@ esplugin {
archivesBaseName = 'x-pack-security' archivesBaseName = 'x-pack-security'
dependencies { 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: ':modules:transport-netty4', configuration: 'runtime')
compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime')

View File

@ -4,7 +4,7 @@ archivesBaseName = 'elasticsearch-security-cli'
dependencies { dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}" 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:bcprov-jdk15on:1.59'
compile 'org.bouncycastle:bcpkix-jdk15on:1.59' compile 'org.bouncycastle:bcpkix-jdk15on:1.59'
testImplementation 'com.google.jimfs:jimfs:1.1' testImplementation 'com.google.jimfs:jimfs:1.1'
@ -17,4 +17,4 @@ dependencies {
dependencyLicenses { dependencyLicenses {
mapping from: /bc.*/, to: 'bouncycastle' mapping from: /bc.*/, to: 'bouncycastle'
} }

View File

@ -19,7 +19,7 @@ archivesBaseName = 'x-pack-sql'
integTest.enabled = false integTest.enabled = false
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
compileOnly(project(':modules:lang-painless')) { compileOnly(project(':modules:lang-painless')) {
// exclude ASM to not affect featureAware task on Java 10+ // exclude ASM to not affect featureAware task on Java 10+
exclude group: "org.ow2.asm" exclude group: "org.ow2.asm"

View File

@ -14,7 +14,7 @@ esplugin {
archivesBaseName = 'x-pack-upgrade' archivesBaseName = 'x-pack-upgrade'
dependencies { dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${version}" compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }
@ -39,7 +39,7 @@ task internalClusterTest(type: RandomizedTestingTask,
include '**/*IT.class' include '**/*IT.class'
systemProperty 'es.set.netty.runtime.available.processors', 'false' systemProperty 'es.set.netty.runtime.available.processors', 'false'
} }
check.dependsOn internalClusterTest check.dependsOn internalClusterTest
internalClusterTest.mustRunAfter test internalClusterTest.mustRunAfter test
// also add an "alias" task to make typing on the command line easier // also add an "alias" task to make typing on the command line easier

View File

@ -25,7 +25,7 @@ dependencyLicenses {
dependencies { dependencies {
compileOnly "org.elasticsearch:elasticsearch:${version}" 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: ':modules:transport-netty4', configuration: 'runtime')
compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime')

View File

@ -11,7 +11,7 @@ apply plugin: 'elasticsearch.build'
test.enabled = false test.enabled = false
dependencies { 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('security'), configuration: 'runtime')) {
// Need to drop the guava dependency here or we get a conflict with watcher's guava dependency. // 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 // 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) check.dependsOn(integTest)
dependencies { 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('watcher'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime') testCompile project(path: xpackModule('ml'), configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime') testCompile project(path: xpackModule('ml'), configuration: 'runtime')
} }

View File

@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('ml'), configuration: 'runtime') testCompile project(path: xpackModule('ml'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts') testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts')

View File

@ -1,7 +1,6 @@
apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.standalone-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime') testCompile project(path: xpackModule('ml'), configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('ml'), configuration: 'runtime') testCompile project(path: xpackModule('ml'), configuration: 'runtime')
} }

View File

@ -3,7 +3,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask
apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.standalone-test'
dependencies { 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('core'), configuration: 'testArtifacts')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
integTestCluster { integTestCluster {

View File

@ -5,7 +5,7 @@ apply plugin: 'elasticsearch.standalone-test'
apply plugin: 'elasticsearch.vagrantsupport' apply plugin: 'elasticsearch.vagrantsupport'
dependencies { 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('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }
@ -32,4 +32,3 @@ namingConventions {
// integ tests use Tests instead of IT // integ tests use Tests instead of IT
skipIntegTestInDisguise = true skipIntegTestInDisguise = true
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:reindex') testCompile project(path: ':modules:reindex')

View File

@ -7,7 +7,7 @@ import java.nio.charset.StandardCharsets
apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.standalone-test'
dependencies { 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 testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit
} }

View File

@ -10,7 +10,7 @@ apply plugin: 'elasticsearch.build'
test.enabled = false test.enabled = false
dependencies { 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('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit
} }
@ -284,7 +284,7 @@ subprojects {
check.dependsOn(integTest) check.dependsOn(integTest)
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('watcher')) testCompile project(path: xpackModule('watcher'))
} }

View File

@ -6,7 +6,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile 'com.google.jimfs:jimfs:1.1' testCompile 'com.google.jimfs:jimfs:1.1'
@ -84,4 +84,3 @@ thirdPartyAudit.excludes = [
// missing // missing
'com.ibm.icu.lang.UCharacter' 'com.ibm.icu.lang.UCharacter'
] ]

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime') testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
} }

View File

@ -8,7 +8,7 @@ esplugin {
} }
dependencies { dependencies {
compileOnly project(path: xpackModule('core'), configuration: 'runtime') compileOnly project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime') testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('security'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime') testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
// bring in graph rest test suite // bring in graph rest test suite

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core')) testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackModule('watcher')) testCompile project(path: xpackModule('watcher'))
testCompile project(path: xpackModule('monitoring')) testCompile project(path: xpackModule('monitoring'))
} }
@ -24,4 +24,3 @@ integTestCluster {
// one of the exporters should configure cluster alerts // one of the exporters should configure cluster alerts
// setting 'xpack.monitoring.exporters.my_http.cluster_alerts.management.enabled', 'true' // setting 'xpack.monitoring.exporters.my_http.cluster_alerts.management.enabled', 'true'
} }

View File

@ -15,7 +15,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
String outputDir = "${buildDir}/generated-resources/${project.name}" String outputDir = "${buildDir}/generated-resources/${project.name}"

View File

@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
ext.pluginsCount = 0 ext.pluginsCount = 0

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
// bring in watcher rest test suite // bring in watcher rest test suite

View File

@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('watcher'), configuration: 'runtime')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
testCompile project(path: ':modules:lang-painless', configuration: 'runtime') testCompile project(path: ':modules:lang-painless', configuration: 'runtime')

View File

@ -1,5 +1,5 @@
dependencies { dependencies {
testCompile "org.elasticsearch.plugin:x-pack-core:${version}" testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
Project mainProject = project Project mainProject = project
@ -20,7 +20,7 @@ subprojects {
} }
dependencies { dependencies {
testCompile "org.elasticsearch.plugin:x-pack-core:${version}" testCompile project(path: xpackModule('core'), configuration: 'shadow')
} }
integTestCluster { integTestCluster {

View File

@ -4,7 +4,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('watcher'), configuration: 'runtime')
} }

View File

@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('watcher'), configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('watcher'), configuration: 'runtime')
} }

View File

@ -5,7 +5,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { 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('watcher'), configuration: 'runtime')
} }

View File

@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-test'
dependencies { dependencies {
testCompile project(path: xpackModule('core'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'shadow')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime') testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
} }

View File

@ -3,7 +3,7 @@ apply plugin: 'elasticsearch.build'
dependencies { dependencies {
compile 'org.ow2.asm:asm:6.2' compile 'org.ow2.asm:asm:6.2'
compile "org.elasticsearch:elasticsearch:${version}" 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}" testCompile "org.elasticsearch.test:framework:${version}"
} }

View File

@ -9,8 +9,8 @@ archivesBaseName = 'x-pack-transport'
dependencies { dependencies {
// this "api" dependency looks weird, but it is correct, as it contains // 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. // all of x-pack for now, and transport client will be going away in the future.
compile "org.elasticsearch.plugin:x-pack-core:${version}" compile project(path: xpackModule('core'), configuration: 'shadow')
compile "org.elasticsearch.client:transport:${version}" compile "org.elasticsearch.client:transport:${version}"
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testCompile "junit:junit:${versions.junit}" testCompile "junit:junit:${versions.junit}"