From e657d947205fb06a9db9d0b40235d7e521214acd Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Mon, 3 Jun 2019 16:18:45 -0700 Subject: [PATCH] Remove unnecessary usage of Gradle dependency substitution rules (#42773) (cherry picked from commit 12d583dbf6f7d44f00aa365e34fc7e937c3c61f7) --- benchmarks/build.gradle | 2 +- build.gradle | 70 ++---------------- buildSrc/build.gradle | 5 ++ .../gradle/plugin/PluginBuildPlugin.groovy | 10 ++- .../gradle/precommit/PrecommitTasks.groovy | 38 +++++----- .../gradle/test/RestIntegTestTask.groovy | 2 +- .../test/StandaloneRestTestPlugin.groovy | 2 +- .../gradle/tool/ClasspathUtils.java | 23 ++++++ buildSrc/src/main/resources/buildSrc.marker | 0 client/benchmark/build.gradle | 6 +- client/rest-high-level/build.gradle | 24 +++---- client/rest/build.gradle | 4 +- client/sniffer/build.gradle | 6 +- client/test/build.gradle | 2 +- client/transport/build.gradle | 14 ++-- distribution/build.gradle | 2 +- distribution/tools/plugin-cli/build.gradle | 6 +- libs/build.gradle | 10 +-- libs/cli/build.gradle | 2 +- libs/core/build.gradle | 6 +- libs/dissect/build.gradle | 14 ++-- libs/geo/build.gradle | 6 +- libs/grok/build.gradle | 10 ++- libs/nio/build.gradle | 18 ++--- libs/secure-sm/build.gradle | 18 ++--- libs/ssl-config/build.gradle | 8 +-- libs/x-content/build.gradle | 18 ++--- modules/ingest-common/build.gradle | 4 +- modules/lang-painless/build.gradle | 2 +- modules/lang-painless/spi/build.gradle | 2 +- modules/reindex/build.gradle | 4 +- plugins/examples/build.gradle | 19 +++++ plugins/transport-nio/build.gradle | 2 +- qa/ccs-unavailable-clusters/build.gradle | 2 +- qa/multi-cluster-search/build.gradle | 2 +- qa/vagrant/build.gradle | 2 +- qa/wildfly/build.gradle | 2 +- server/build.gradle | 18 ++--- .../elasticsearch/bootstrap/security.policy | 2 +- settings.gradle | 72 +++++++++---------- test/framework/build.gradle | 10 +-- test/logger-usage/build.gradle | 2 +- x-pack/build.gradle | 14 ---- x-pack/docs/build.gradle | 1 - x-pack/license-tools/build.gradle | 6 +- x-pack/plugin/build.gradle | 4 +- x-pack/plugin/ccr/build.gradle | 2 +- x-pack/plugin/core/build.gradle | 4 +- x-pack/plugin/data-frame/build.gradle | 2 +- x-pack/plugin/deprecation/build.gradle | 2 +- x-pack/plugin/graph/build.gradle | 1 - .../graph/qa/with-security/build.gradle | 2 +- x-pack/plugin/ilm/build.gradle | 1 - x-pack/plugin/logstash/build.gradle | 1 - x-pack/plugin/ml/build.gradle | 5 +- .../ml/qa/basic-multi-node/build.gradle | 2 +- x-pack/plugin/ml/qa/disabled/build.gradle | 2 +- .../ml/qa/ml-with-security/build.gradle | 1 - .../qa/native-multi-node-tests/build.gradle | 1 - .../ml/qa/no-bootstrap-tests/build.gradle | 2 +- .../ml/qa/single-node-tests/build.gradle | 2 +- x-pack/plugin/monitoring/build.gradle | 9 ++- x-pack/plugin/rollup/build.gradle | 5 +- x-pack/plugin/security/build.gradle | 1 - x-pack/plugin/security/cli/build.gradle | 5 +- .../qa/basic-enable-security/build.gradle | 1 - .../security/qa/security-basic/build.gradle | 1 - .../plugin/security/qa/tls-basic/build.gradle | 1 - x-pack/plugin/sql/build.gradle | 5 +- x-pack/plugin/sql/jdbc/build.gradle | 6 +- x-pack/plugin/sql/qa/build.gradle | 4 +- x-pack/plugin/sql/qa/security/build.gradle | 4 +- x-pack/plugin/sql/sql-action/build.gradle | 6 +- x-pack/plugin/sql/sql-cli/build.gradle | 4 +- x-pack/plugin/sql/sql-client/build.gradle | 2 +- x-pack/plugin/sql/sql-proto/build.gradle | 6 +- x-pack/plugin/watcher/build.gradle | 6 +- x-pack/qa/kerberos-tests/build.gradle | 2 +- x-pack/qa/oidc-op-tests/build.gradle | 1 - x-pack/qa/openldap-tests/build.gradle | 1 - .../reindex-tests-with-security/build.gradle | 1 - x-pack/qa/rolling-upgrade/build.gradle | 2 +- .../build.gradle | 2 +- .../build.gradle | 1 - x-pack/qa/smoke-test-plugins-ssl/build.gradle | 2 +- x-pack/qa/third-party/jira/build.gradle | 2 +- x-pack/qa/third-party/pagerduty/build.gradle | 2 +- x-pack/qa/third-party/slack/build.gradle | 2 +- x-pack/test/feature-aware/build.gradle | 6 +- 89 files changed, 270 insertions(+), 346 deletions(-) create mode 100644 buildSrc/src/main/java/org/elasticsearch/gradle/tool/ClasspathUtils.java create mode 100644 buildSrc/src/main/resources/buildSrc.marker diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index e85f9a5608644..376ad4d4e6716 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -27,7 +27,7 @@ archivesBaseName = 'elasticsearch-benchmarks' test.enabled = false dependencies { - compile("org.elasticsearch:elasticsearch:${version}") { + compile(project(":server")) { // JMH ships with the conflicting version 4.6. This prevents us from using jopt-simple in benchmarks (which should be ok) but allows // us to invoke the JMH uberjar as usual. exclude group: 'net.sf.jopt-simple', module: 'jopt-simple' diff --git a/build.gradle b/build.gradle index 2a79de7e4fc2f..f3d683671e4a2 100644 --- a/build.gradle +++ b/build.gradle @@ -209,69 +209,7 @@ allprojects { javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet') } - /* Sets up the dependencies that we build as part of this project but - register as though they were external to resolve internally. We register - them as external dependencies so the build plugin that we use can be used - to build elasticsearch plugins outside of the elasticsearch source tree. */ - ext.projectSubstitutions = [ - "org.elasticsearch.gradle:build-tools:${version}": ':build-tools', - "org.elasticsearch:rest-api-spec:${version}": ':rest-api-spec', - "org.elasticsearch:elasticsearch:${version}": ':server', - "org.elasticsearch:elasticsearch-cli:${version}": ':libs:elasticsearch-cli', - "org.elasticsearch:elasticsearch-core:${version}": ':libs:core', - "org.elasticsearch:elasticsearch-nio:${version}": ':libs:nio', - "org.elasticsearch:elasticsearch-x-content:${version}": ':libs:x-content', - "org.elasticsearch:elasticsearch-geo:${version}": ':libs:elasticsearch-geo', - "org.elasticsearch:elasticsearch-secure-sm:${version}": ':libs:secure-sm', - "org.elasticsearch:elasticsearch-ssl-config:${version}": ':libs:elasticsearch-ssl-config', - "org.elasticsearch.client:elasticsearch-rest-client:${version}": ':client:rest', - "org.elasticsearch.client:elasticsearch-rest-client-sniffer:${version}": ':client:sniffer', - "org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}": ':client:rest-high-level', - "org.elasticsearch.client:test:${version}": ':client:test', - "org.elasticsearch.client:transport:${version}": ':client:transport', - "org.elasticsearch.plugin:elasticsearch-scripting-painless-spi:${version}": ':modules:lang-painless:spi', - "org.elasticsearch.test:framework:${version}": ':test:framework', - "org.elasticsearch.test:logger-usage:${version}": ':test:logger-usage', - "org.elasticsearch.xpack.test:feature-aware:${version}": ':x-pack:test:feature-aware', - // for transport client - "org.elasticsearch.plugin:transport-netty4-client:${version}": ':modules:transport-netty4', - "org.elasticsearch.plugin:reindex-client:${version}": ':modules:reindex', - "org.elasticsearch.plugin:lang-mustache-client:${version}": ':modules:lang-mustache', - "org.elasticsearch.plugin:parent-join-client:${version}": ':modules:parent-join', - "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}": ':modules:aggs-matrix-stats', - "org.elasticsearch.plugin:percolator-client:${version}": ':modules:percolator', - "org.elasticsearch.plugin:rank-eval-client:${version}": ':modules:rank-eval', - // for security example plugins - "org.elasticsearch.plugin:x-pack-core:${version}": ':x-pack:plugin:core', - "org.elasticsearch.client:x-pack-transport:${version}": ':x-pack:transport-client' - ] - - /* - * Gradle only resolve project substitutions during dependency resolution but - * we sometimes want to do the resolution at other times. This creates a - * convenient method we can call to do it. - */ - ext.dependencyToProject = { Dependency dep -> - if (dep instanceof ProjectDependency) { - return dep.dependencyProject - } else { - String substitution = projectSubstitutions.get("${dep.group}:${dep.name}:${dep.version}") - if (substitution != null) { - return findProject(substitution) - } - return null - } - } - project.afterEvaluate { - configurations.matching { it.canBeResolved }.all { - resolutionStrategy.dependencySubstitution { DependencySubstitutions subs -> - projectSubstitutions.each { k,v -> - subs.substitute(subs.module(k)).with(subs.project(v)) - } - } - } - // Handle javadoc dependencies across projects. Order matters: the linksOffline for // org.elasticsearch:elasticsearch must be the last one or all the links for the // other packages (e.g org.elasticsearch.client) will point to server rather than @@ -280,10 +218,10 @@ allprojects { String artifactsHost = VersionProperties.elasticsearch.endsWith("-SNAPSHOT") ? "https://snapshots.elastic.co" : "https://artifacts.elastic.co" Closure sortClosure = { a, b -> b.group <=> a.group } Closure depJavadocClosure = { shadowed, dep -> - if (dep.group == null || false == dep.group.startsWith('org.elasticsearch')) { + if ((dep instanceof ProjectDependency) == false) { return } - Project upstreamProject = project.ext.dependencyToProject(dep) + Project upstreamProject = dep.dependencyProject if (upstreamProject == null) { return } @@ -339,8 +277,8 @@ gradle.projectsEvaluated { integTest.mustRunAfter test } configurations.matching { it.canBeResolved }.all { Configuration configuration -> - dependencies.all { Dependency dep -> - Project upstreamProject = dependencyToProject(dep) + dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> + Project upstreamProject = dep.dependencyProject if (upstreamProject != null) { if (project.path == upstreamProject.path) { // TODO: distribution integ tests depend on themselves (!), fix that diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index d3a16f55277d7..7a8b901f1c597 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -148,6 +148,11 @@ if (project != rootProject) { distribution project(':distribution:archives:linux-tar') distribution project(':distribution:archives:oss-linux-tar') } + + // for external projects we want to remove the marker file indicating we are running the Elasticsearch project + processResources { + exclude 'buildSrc.marker' + } String localDownloads = "${rootProject.buildDir}/local-downloads" task setupLocalDownloads(type:Copy) { 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 e04d0966c412d..692181710f4da 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy @@ -27,6 +27,7 @@ import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.test.RestIntegTestTask import org.elasticsearch.gradle.test.RunTask import org.elasticsearch.gradle.testclusters.TestClustersPlugin +import org.elasticsearch.gradle.tool.ClasspathUtils import org.gradle.api.InvalidUserDataException import org.gradle.api.Plugin import org.gradle.api.Project @@ -154,8 +155,13 @@ class PluginBuildPlugin implements Plugin { private static void configureDependencies(Project project) { project.dependencies { - compileOnly "org.elasticsearch:elasticsearch:${project.versions.elasticsearch}" - testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}" + if (ClasspathUtils.isElasticsearchProject()) { + compileOnly project.project(':server') + testCompile project.project(':test:framework') + } else { + compileOnly "org.elasticsearch:elasticsearch:${project.versions.elasticsearch}" + testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}" + } // we "upgrade" these optional deps to provided for plugins, since they will run // with a full elasticsearch server that includes optional deps compileOnly "org.locationtech.spatial4j:spatial4j:${project.versions.spatial4j}" diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy index f656f177ce67b..a5d4f3fcd9495 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy @@ -23,11 +23,13 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin import org.elasticsearch.gradle.ExportElasticsearchBuildResourcesTask import org.elasticsearch.gradle.VersionProperties +import org.elasticsearch.gradle.tool.ClasspathUtils import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.JavaBasePlugin import org.gradle.api.plugins.quality.Checkstyle + /** * Validation tasks which should be run before committing. These run before tests. */ @@ -40,18 +42,18 @@ class PrecommitTasks { public static Task create(Project project, boolean includeDependencyLicenses) { project.configurations.create("forbiddenApisCliJar") project.dependencies { - forbiddenApisCliJar ('de.thetaphi:forbiddenapis:2.6') + forbiddenApisCliJar('de.thetaphi:forbiddenapis:2.6') } List precommitTasks = [ - configureCheckstyle(project), - configureForbiddenApisCli(project), - project.tasks.create('forbiddenPatterns', ForbiddenPatternsTask.class), - project.tasks.create('licenseHeaders', LicenseHeadersTask.class), - project.tasks.create('filepermissions', FilePermissionsTask.class), - configureJarHell(project), - configureThirdPartyAudit(project), - configureTestingConventions(project) + configureCheckstyle(project), + configureForbiddenApisCli(project), + project.tasks.create('forbiddenPatterns', ForbiddenPatternsTask.class), + project.tasks.create('licenseHeaders', LicenseHeadersTask.class), + project.tasks.create('filepermissions', FilePermissionsTask.class), + configureJarHell(project), + configureThirdPartyAudit(project), + configureTestingConventions(project) ] // tasks with just tests don't need dependency licenses, so this flag makes adding @@ -85,10 +87,10 @@ class PrecommitTasks { } return project.tasks.create([ - name: 'precommit', - group: JavaBasePlugin.VERIFICATION_GROUP, - description: 'Runs all non-test checks.', - dependsOn: precommitTasks + name : 'precommit', + group : JavaBasePlugin.VERIFICATION_GROUP, + description: 'Runs all non-test checks.', + dependsOn : precommitTasks ]) } @@ -168,7 +170,7 @@ class PrecommitTasks { ) } } - Task forbiddenApis = project.tasks.getByName("forbiddenApis") + Task forbiddenApis = project.tasks.getByName("forbiddenApis") forbiddenApis.group = "" return forbiddenApis } @@ -211,7 +213,7 @@ class PrecommitTasks { project.checkstyle { config = project.resources.text.fromFile(checkstyleConf, 'UTF-8') configProperties = [ - suppressions: checkstyleSuppressions + suppressions: checkstyleSuppressions ] toolVersion = CHECKSTYLE_VERSION } @@ -229,9 +231,11 @@ class PrecommitTasks { } private static Task configureLoggerUsage(Project project) { + Object dependency = ClasspathUtils.isElasticsearchProject() ? project.project(':test:logger-usage') : + "org.elasticsearch.test:logger-usage:${VersionProperties.elasticsearch}" + project.configurations.create('loggerUsagePlugin') - project.dependencies.add('loggerUsagePlugin', - "org.elasticsearch.test:logger-usage:${VersionProperties.elasticsearch}") + project.dependencies.add('loggerUsagePlugin', dependency) return project.tasks.create('loggerUsageCheck', LoggerUsageTask.class) { classpath = project.configurations.loggerUsagePlugin } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy index 0ded69756eb98..2fe80c2fc47d6 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy @@ -249,7 +249,7 @@ class RestIntegTestTask extends DefaultTask { restSpec } project.dependencies { - restSpec "org.elasticsearch:rest-api-spec:${VersionProperties.elasticsearch}" + restSpec project.project(':rest-api-spec') } Task copyRestSpec = project.tasks.findByName('copyRestSpec') if (copyRestSpec != null) { diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy index c9a26eb74b54d..f3ebfecc32267 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy @@ -79,7 +79,7 @@ class StandaloneRestTestPlugin implements Plugin { // create a compileOnly configuration as others might expect it project.configurations.create("compileOnly") - project.dependencies.add('testCompile', "org.elasticsearch.test:framework:${VersionProperties.elasticsearch}") + project.dependencies.add('testCompile', project.project(':test:framework')) EclipseModel eclipse = project.extensions.getByType(EclipseModel) eclipse.classpath.sourceSets = [testSourceSet] diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/tool/ClasspathUtils.java b/buildSrc/src/main/java/org/elasticsearch/gradle/tool/ClasspathUtils.java new file mode 100644 index 0000000000000..40ec6bd71830a --- /dev/null +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/tool/ClasspathUtils.java @@ -0,0 +1,23 @@ +package org.elasticsearch.gradle.tool; + +public class ClasspathUtils { + private static boolean isElasticsearchProject; + + static { + // look for buildSrc marker file, if it exists then we are running in the context of the elastic/elasticsearch build + isElasticsearchProject = ClasspathUtils.class.getResource("/buildSrc.marker") != null; + } + + private ClasspathUtils() { + } + + /** + * Determine if we are running in the context of the `elastic/elasticsearch` project. This method will return {@code false} when + * the build-tools project is pulled in as an external dependency. + * + * @return if we are currently running in the `elastic/elasticsearch` project + */ + public static boolean isElasticsearchProject() { + return isElasticsearchProject; + } +} diff --git a/buildSrc/src/main/resources/buildSrc.marker b/buildSrc/src/main/resources/buildSrc.marker new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/client/benchmark/build.gradle b/client/benchmark/build.gradle index a53f102034009..eb2c634f97203 100644 --- a/client/benchmark/build.gradle +++ b/client/benchmark/build.gradle @@ -34,12 +34,12 @@ test.enabled = false dependencies { compile 'org.apache.commons:commons-math3:3.2' - compile("org.elasticsearch.client:elasticsearch-rest-client:${version}") + compile project(":client:rest") // bottleneck should be the client, not Elasticsearch compile project(path: ':client:client-benchmark-noop-api-plugin') // for transport client - compile("org.elasticsearch:elasticsearch:${version}") - compile("org.elasticsearch.client:transport:${version}") + compile project(":server") + compile project(":client:transport") compile project(path: ':modules:transport-netty4', configuration: 'runtime') compile project(path: ':modules:reindex', configuration: 'runtime') compile project(path: ':modules:lang-mustache', configuration: 'runtime') diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index a5035a70bcee2..77e656b482691 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -50,24 +50,24 @@ dependencies { * Everything in the "shadow" configuration is *not* copied into the * shadowJar. */ - compile "org.elasticsearch:elasticsearch:${version}" - compile "org.elasticsearch.client:elasticsearch-rest-client:${version}" - compile "org.elasticsearch.plugin:parent-join-client:${version}" - compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}" - compile "org.elasticsearch.plugin:rank-eval-client:${version}" - compile "org.elasticsearch.plugin:lang-mustache-client:${version}" + compile project(':server') + compile project(':client:rest') + compile project(':modules:parent-join') + compile project(':modules:aggs-matrix-stats') + compile project(':modules:rank-eval') + compile project(':modules:lang-mustache') - testCompile "org.elasticsearch.client:test:${version}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(':client:test') + testCompile project(':test:framework') testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}" //this is needed to make RestHighLevelClientTests#testApiNamingConventions work from IDEs - testCompile "org.elasticsearch:rest-api-spec:${version}" - // Needed for serialization tests: + testCompile project(":rest-api-spec") + // Needed for serialization tests: // (In order to serialize a server side class to a client side class or the other way around) - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') - restSpec "org.elasticsearch:rest-api-spec:${version}" + restSpec project(':rest-api-spec') } //we need to copy the yaml spec so we can check naming (see RestHighlevelClientTests#testApiNamingConventions) diff --git a/client/rest/build.gradle b/client/rest/build.gradle index ee0317457118d..352b15699d081 100644 --- a/client/rest/build.gradle +++ b/client/rest/build.gradle @@ -44,7 +44,7 @@ dependencies { compile "commons-codec:commons-codec:${versions.commonscodec}" compile "commons-logging:commons-logging:${versions.commonslogging}" - testCompile "org.elasticsearch.client:test:${version}" + testCompile project(":client:test") testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" @@ -68,7 +68,7 @@ forbiddenApisTest { } // JarHell is part of es server, which we don't want to pull in -// TODO: Not anymore. Now in :libs:core +// TODO: Not anymore. Now in :libs:elasticsearch-core jarHell.enabled=false testingConventions { diff --git a/client/sniffer/build.gradle b/client/sniffer/build.gradle index 2f9eeca6020c4..8b4d21537a109 100644 --- a/client/sniffer/build.gradle +++ b/client/sniffer/build.gradle @@ -35,14 +35,14 @@ publishing { } dependencies { - compile "org.elasticsearch.client:elasticsearch-rest-client:${version}" + compile project(":client:rest") compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" compile "commons-codec:commons-codec:${versions.commonscodec}" compile "commons-logging:commons-logging:${versions.commonslogging}" compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile "org.elasticsearch.client:test:${version}" + testCompile project(":client:test") testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}" testCompile "org.elasticsearch:securemock:${versions.securemock}" @@ -68,7 +68,7 @@ dependencyLicenses { } // JarHell is part of es server, which we don't want to pull in -// TODO: Not anymore. Now in :libs:core +// TODO: Not anymore. Now in :libs:elasticsearch-core jarHell.enabled=false testingConventions { diff --git a/client/test/build.gradle b/client/test/build.gradle index 184606e360791..169172736ecd3 100644 --- a/client/test/build.gradle +++ b/client/test/build.gradle @@ -44,7 +44,7 @@ forbiddenApisTest { } // JarHell is part of es server, which we don't want to pull in -// TODO: Not anymore. Now in :libs:core +// TODO: Not anymore. Now in :libs:elasticsearch-core jarHell.enabled=false // TODO: should we have licenses for our test deps? diff --git a/client/transport/build.gradle b/client/transport/build.gradle index c1e4503445bb7..36bd674018267 100644 --- a/client/transport/build.gradle +++ b/client/transport/build.gradle @@ -23,13 +23,13 @@ apply plugin: 'nebula.maven-scm' group = 'org.elasticsearch.client' dependencies { - compile "org.elasticsearch:elasticsearch:${version}" - compile "org.elasticsearch.plugin:transport-netty4-client:${version}" - compile "org.elasticsearch.plugin:reindex-client:${version}" - compile "org.elasticsearch.plugin:lang-mustache-client:${version}" - compile "org.elasticsearch.plugin:percolator-client:${version}" - compile "org.elasticsearch.plugin:parent-join-client:${version}" - compile "org.elasticsearch.plugin:rank-eval-client:${version}" + compile project(":server") + compile project(":modules:transport-netty4") + compile project(":modules:reindex") + compile project(":modules:lang-mustache") + compile project(":modules:percolator") + compile project(":modules:parent-join") + compile project(":modules:rank-eval") testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" diff --git a/distribution/build.gradle b/distribution/build.gradle index a92b157eabae8..940cbd0369a87 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -241,7 +241,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { // delay by using closures, since they have not yet been configured, so no jar task exists yet from { project(':server').jar } from { project(':server').configurations.runtime } - from { project(':libs:plugin-classloader').jar } + from { project(':libs:elasticsearch-plugin-classloader').jar } from { project(':distribution:tools:java-version-checker').jar } from { project(':distribution:tools:launchers').jar } into('tools/plugin-cli') { diff --git a/distribution/tools/plugin-cli/build.gradle b/distribution/tools/plugin-cli/build.gradle index 48bc899cd29b4..3db958c6ec41e 100644 --- a/distribution/tools/plugin-cli/build.gradle +++ b/distribution/tools/plugin-cli/build.gradle @@ -22,11 +22,11 @@ apply plugin: 'elasticsearch.build' archivesBaseName = 'elasticsearch-plugin-cli' dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" - compileOnly "org.elasticsearch:elasticsearch-cli:${version}" + compileOnly project(":server") + compileOnly project(":libs:elasticsearch-cli") compile "org.bouncycastle:bcpg-jdk15on:${versions.bouncycastle}" compile "org.bouncycastle:bcprov-jdk15on:${versions.bouncycastle}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") testCompile 'com.google.jimfs:jimfs:1.1' testCompile 'com.google.guava:guava:18.0' } diff --git a/libs/build.gradle b/libs/build.gradle index b0924aa1f54f1..03b5d2c611e71 100644 --- a/libs/build.gradle +++ b/libs/build.gradle @@ -26,19 +26,19 @@ subprojects { /* * Subprojects may depend on the "core" lib but may not depend on any - * other libs. This keeps are dependencies simpler. + * other libs. This keeps our dependencies simpler. */ project.afterEvaluate { configurations.all { Configuration conf -> - dependencies.all { Dependency dep -> - Project depProject = dependencyToProject(dep) + dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> + Project depProject = dep.dependencyProject if (depProject != null - && false == depProject.path.equals(':libs:core') + && false == depProject.path.equals(':libs:elasticsearch-core') && false == isEclipse && depProject.path.startsWith(':libs')) { throw new InvalidUserDataException("projects in :libs " + "may not depend on other projects libs except " - + ":libs:core but " + + ":libs:elasticsearch-core but " + "${project.path} depends on ${depProject.path}") } } diff --git a/libs/cli/build.gradle b/libs/cli/build.gradle index b1f3b338255c4..a97c62096a512 100644 --- a/libs/cli/build.gradle +++ b/libs/cli/build.gradle @@ -23,7 +23,7 @@ apply plugin: 'nebula.maven-scm' dependencies { compile 'net.sf.jopt-simple:jopt-simple:5.0.2' - compile "org.elasticsearch:elasticsearch-core:${version}" + compile project(':libs:elasticsearch-core') } test.enabled = false diff --git a/libs/core/build.gradle b/libs/core/build.gradle index 36c40f747d691..046c3d070e841 100644 --- a/libs/core/build.gradle +++ b/libs/core/build.gradle @@ -82,14 +82,14 @@ dependencies { } if (isEclipse == false || project.path == ":libs:core-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-core' } } } forbiddenApisMain { - // :libs:core does not depend on server + // :libs:elasticsearch-core does not depend on server // TODO: Need to decide how we want to handle for forbidden signatures with the changes to server replaceSignatureFiles 'jdk-signatures' } @@ -97,7 +97,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:core") { + if (project.path == ":libs:elasticsearch-core") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/dissect/build.gradle b/libs/dissect/build.gradle index 853c78646c25b..7e71f86f64f44 100644 --- a/libs/dissect/build.gradle +++ b/libs/dissect/build.gradle @@ -17,17 +17,15 @@ * under the License. */ -archivesBaseName = 'elasticsearch-dissect' - dependencies { - if (isEclipse == false || project.path == ":libs:dissect-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { - exclude group: 'org.elasticsearch', module: 'dissect' + if (isEclipse == false || project.path == ":libs:elasticsearch-dissect-tests") { + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-dissect' } } testCompile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") - testCompile("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}") + testCompile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" + testCompile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" } forbiddenApisMain { @@ -37,7 +35,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:dissect") { + if (project.path == ":libs:elasticsearch-dissect") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/geo/build.gradle b/libs/geo/build.gradle index ab3419b93b9b8..e2e5a11d53586 100644 --- a/libs/geo/build.gradle +++ b/libs/geo/build.gradle @@ -22,8 +22,8 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' dependencies { - if (isEclipse == false || project.path == ":libs:geo-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + if (isEclipse == false || project.path == ":libs:elasticsearch-geo-tests") { + testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-geo' } } @@ -38,7 +38,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:geo") { + if (project.path == ":libs:elasticsearch-geo") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index 9ca02df35aabe..ca3634805195d 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -17,16 +17,14 @@ * under the License. */ -archivesBaseName = 'elasticsearch-grok' - dependencies { compile 'org.jruby.joni:joni:2.1.6' // joni dependencies: compile 'org.jruby.jcodings:jcodings:1.0.12' - if (isEclipse == false || project.path == ":libs:grok-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { - exclude group: 'org.elasticsearch', module: 'grok' + if (isEclipse == false || project.path == ":libs:elasticsearch-grok-tests") { + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-grok' } } } @@ -38,7 +36,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:grok") { + if (project.path == ":libs:elasticsearch-grok") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/nio/build.gradle b/libs/nio/build.gradle index 66436bb040e18..d6d0eaea0ab83 100644 --- a/libs/nio/build.gradle +++ b/libs/nio/build.gradle @@ -19,25 +19,15 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' -archivesBaseName = 'elasticsearch-nio' - -publishing { - publications { - nebula { - artifactId = archivesBaseName - } - } -} - dependencies { - compile "org.elasticsearch:elasticsearch-core:${version}" + compile project(':libs:elasticsearch-core') testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - if (isEclipse == false || project.path == ":libs:nio-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + if (isEclipse == false || project.path == ":libs:elasticsearch-nio-tests") { + testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-nio' } } @@ -46,7 +36,7 @@ dependencies { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:nio") { + if (project.path == ":libs:elasticsearch-nio") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/secure-sm/build.gradle b/libs/secure-sm/build.gradle index bbd44afc70a6d..3e79d9ee2e84b 100644 --- a/libs/secure-sm/build.gradle +++ b/libs/secure-sm/build.gradle @@ -19,16 +19,6 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' -archivesBaseName = 'elasticsearch-secure-sm' - -publishing { - publications { - nebula { - artifactId = archivesBaseName - } - } -} - dependencies { // do not add non-test compile dependencies to secure-sm without a good reason to do so @@ -36,9 +26,9 @@ dependencies { testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - if (isEclipse == false || project.path == ":libs:secure-sm-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { - exclude group: 'org.elasticsearch', module: 'secure-sm' + if (isEclipse == false || project.path == ":libs:elasticsearch-secure-sm-tests") { + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-secure-sm' } } } @@ -50,7 +40,7 @@ forbiddenApisMain { if (isEclipse) { // in Eclipse the project is under a fake root so we need to change around the source sets sourceSets { - if (project.path == ":libs:secure-sm") { + if (project.path == ":libs:elasticsearch-secure-sm") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index 860cdcd9e6fc8..71ebd642a4339 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -19,10 +19,10 @@ apply plugin: "nebula.maven-scm" dependencies { - compile "org.elasticsearch:elasticsearch-core:${version}" + compile project(':libs:elasticsearch-core') - if (isEclipse == false || project.path == ":libs:ssl-config-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + if (isEclipse == false || project.path == ":libs:elasticsearch-ssl-config-tests") { + testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-ssl-config' } } @@ -35,7 +35,7 @@ dependencies { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:ssl-config") { + if (project.path == ":libs:elasticsearch-ssl-config") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/libs/x-content/build.gradle b/libs/x-content/build.gradle index 0e99d80da1e00..e54427c058304 100644 --- a/libs/x-content/build.gradle +++ b/libs/x-content/build.gradle @@ -21,18 +21,8 @@ apply plugin: 'elasticsearch.build' apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' -archivesBaseName = 'elasticsearch-x-content' - -publishing { - publications { - nebula { - artifactId = archivesBaseName - } - } -} - dependencies { - compile "org.elasticsearch:elasticsearch-core:${version}" + compile project(':libs:elasticsearch-core') compile "org.yaml:snakeyaml:${versions.snakeyaml}" compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" @@ -44,8 +34,8 @@ dependencies { testCompile "junit:junit:${versions.junit}" testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - if (isEclipse == false || project.path == ":libs:x-content-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + if (isEclipse == false || project.path == ":libs:elasticsearch-x-content-tests") { + testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-x-content' } } @@ -61,7 +51,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:x-content") { + if (project.path == ":libs:elasticsearch-x-content") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index a94c375afc3e1..00c444e50e87d 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -25,6 +25,6 @@ esplugin { dependencies { compileOnly project(':modules:lang-painless') - compile project(':libs:grok') - compile project(':libs:dissect') + compile project(':libs:elasticsearch-grok') + compile project(':libs:elasticsearch-dissect') } \ No newline at end of file diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 1f6b722ec308c..6cce3850232e0 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -69,7 +69,7 @@ sourceSets { } dependencies { - docCompile "org.elasticsearch:elasticsearch:${project.versions.elasticsearch}" + docCompile project(':server') docCompile project(':modules:lang-painless') } diff --git a/modules/lang-painless/spi/build.gradle b/modules/lang-painless/spi/build.gradle index 7e43a242a23a9..3f25f247a2b67 100644 --- a/modules/lang-painless/spi/build.gradle +++ b/modules/lang-painless/spi/build.gradle @@ -33,7 +33,7 @@ publishing { } dependencies { - compile "org.elasticsearch:elasticsearch:${version}" + compile project(":server") } // no tests...yet? diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 260c8dcc1df79..17cd8b262637e 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -55,8 +55,8 @@ test { } dependencies { - compile "org.elasticsearch.client:elasticsearch-rest-client:${version}" - compile "org.elasticsearch:elasticsearch-ssl-config:${version}" + compile project(":client:rest") + compile project(":libs:elasticsearch-ssl-config") // for http - testing reindex from remote testCompile project(path: ':modules:transport-netty4', configuration: 'runtime') // for parent/child testing diff --git a/plugins/examples/build.gradle b/plugins/examples/build.gradle index 2b9f3c6433d8f..a251c1bbbe85d 100644 --- a/plugins/examples/build.gradle +++ b/plugins/examples/build.gradle @@ -7,3 +7,22 @@ gradle.projectsEvaluated { } } } + +configure(project('painless-whitelist')) { + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('org.elasticsearch.plugin:elasticsearch-scripting-painless-spi') with project(':modules:lang-painless:spi') + substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') + } + } +} + +configure(project('security-authorization-engine')) { + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('org.elasticsearch.plugin:x-pack-core') with project(':x-pack:plugin:core') + substitute module('org.elasticsearch.client:elasticsearch-rest-high-level-client') with project(':client:rest-high-level') + substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') + } + } +} \ No newline at end of file diff --git a/plugins/transport-nio/build.gradle b/plugins/transport-nio/build.gradle index a982758482cb6..f3b96a3ebe3f5 100644 --- a/plugins/transport-nio/build.gradle +++ b/plugins/transport-nio/build.gradle @@ -25,7 +25,7 @@ esplugin { } dependencies { - compile "org.elasticsearch:elasticsearch-nio:${version}" + compile project(':libs:elasticsearch-nio') // network stack compile "io.netty:netty-buffer:${versions.netty}" diff --git a/qa/ccs-unavailable-clusters/build.gradle b/qa/ccs-unavailable-clusters/build.gradle index c1f2bc9627108..ea80ee983b876 100644 --- a/qa/ccs-unavailable-clusters/build.gradle +++ b/qa/ccs-unavailable-clusters/build.gradle @@ -21,5 +21,5 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' dependencies { - testCompile "org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}" + testCompile project(":client:rest-high-level") } diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index bca12be6754ab..7f923d03f7166 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -22,7 +22,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile "org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}" + testCompile project(":client:rest-high-level") } task remoteClusterTest(type: RestIntegTestTask) { diff --git a/qa/vagrant/build.gradle b/qa/vagrant/build.gradle index 7c342436dd3ca..f5cfcdda03cc6 100644 --- a/qa/vagrant/build.gradle +++ b/qa/vagrant/build.gradle @@ -35,7 +35,7 @@ dependencies { compile "commons-codec:commons-codec:${versions.commonscodec}" compile "commons-logging:commons-logging:${versions.commonslogging}" - compile project(':libs:core') + compile project(':libs:elasticsearch-core') // pulls in the jar built by this project and its dependencies packagingTest project(path: project.path, configuration: 'runtime') diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index dcbf5253bb085..8e5e8ed635d77 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -72,7 +72,7 @@ dependencies { compile "org.apache.logging.log4j:log4j-core:${versions.log4j}" compile project(path: ':client:transport', configuration: 'runtime') wildfly "org.jboss:wildfly:${wildflyVersion}@zip" - testCompile "org.elasticsearch.test:framework:${VersionProperties.elasticsearch}" + testCompile project(':test:framework') } task unzipWildfly(type: Sync) { diff --git a/server/build.gradle b/server/build.gradle index bf9d85e876616..1e75edf251a48 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -74,13 +74,13 @@ if (!isEclipse && !isIdea) { dependencies { - compile "org.elasticsearch:elasticsearch-core:${version}" - compile "org.elasticsearch:elasticsearch-secure-sm:${version}" - compile "org.elasticsearch:elasticsearch-x-content:${version}" - compile "org.elasticsearch:elasticsearch-geo:${version}" + compile project(':libs:elasticsearch-core') + compile project(':libs:elasticsearch-secure-sm') + compile project(':libs:elasticsearch-x-content') + compile project(":libs:elasticsearch-geo") - compileOnly project(':libs:plugin-classloader') - testRuntime project(':libs:plugin-classloader') + compileOnly project(':libs:elasticsearch-plugin-classloader') + testRuntime project(':libs:elasticsearch-plugin-classloader') // lucene compile "org.apache.lucene:lucene-core:${versions.lucene}" @@ -100,7 +100,7 @@ dependencies { compile "org.apache.lucene:lucene-suggest:${versions.lucene}" // utilities - compile "org.elasticsearch:elasticsearch-cli:${version}" + compile project(":libs:elasticsearch-cli") compile 'com.carrotsearch:hppc:0.7.1' // time handling, remove with java 8 time @@ -127,9 +127,9 @@ dependencies { } if (isEclipse == false || project.path == ":server-tests") { - testCompile("org.elasticsearch.test:framework:${version}") { + testCompile(project(":test:framework")) { // tests use the locally compiled version of server - exclude group: 'org.elasticsearch', module: 'elasticsearch' + exclude group: 'org.elasticsearch', module: 'server' } } testCompile 'com.google.jimfs:jimfs:1.1' diff --git a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy index 4df99ef6f8836..fbfa0f39b1691 100644 --- a/server/src/main/resources/org/elasticsearch/bootstrap/security.policy +++ b/server/src/main/resources/org/elasticsearch/bootstrap/security.policy @@ -47,7 +47,7 @@ grant codeBase "${codebase.lucene-misc}" { permission java.nio.file.LinkPermission "hard"; }; -grant codeBase "${codebase.plugin-classloader}" { +grant codeBase "${codebase.elasticsearch-plugin-classloader}" { // needed to create the classloader which allows plugins to extend other plugins permission java.lang.RuntimePermission "createClassLoader"; }; diff --git a/settings.gradle b/settings.gradle index 7532230e7b81e..c20ad55a46222 100644 --- a/settings.gradle +++ b/settings.gradle @@ -117,43 +117,47 @@ include projects.toArray(new String[0]) project(':build-tools').projectDir = new File(rootProject.projectDir, 'buildSrc') +project(":libs").children.each { libsProject -> + libsProject.name = "elasticsearch-${libsProject.name}" +} + if (isEclipse) { project(":server").projectDir = new File(rootProject.projectDir, 'server/src/main') project(":server").buildFileName = 'eclipse-build.gradle' project(":server-tests").projectDir = new File(rootProject.projectDir, 'server/src/test') project(":server-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:core").projectDir = new File(rootProject.projectDir, 'libs/core/src/main') - project(":libs:core").buildFileName = 'eclipse-build.gradle' - project(":libs:core-tests").projectDir = new File(rootProject.projectDir, 'libs/core/src/test') - project(":libs:core-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:dissect").projectDir = new File(rootProject.projectDir, 'libs/dissect/src/main') - project(":libs:dissect").buildFileName = 'eclipse-build.gradle' - project(":libs:dissect-tests").projectDir = new File(rootProject.projectDir, 'libs/dissect/src/test') - project(":libs:dissect-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:nio").projectDir = new File(rootProject.projectDir, 'libs/nio/src/main') - project(":libs:nio").buildFileName = 'eclipse-build.gradle' - project(":libs:nio-tests").projectDir = new File(rootProject.projectDir, 'libs/nio/src/test') - project(":libs:nio-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:x-content").projectDir = new File(rootProject.projectDir, 'libs/x-content/src/main') - project(":libs:x-content").buildFileName = 'eclipse-build.gradle' - project(":libs:x-content-tests").projectDir = new File(rootProject.projectDir, 'libs/x-content/src/test') - project(":libs:x-content-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:secure-sm").projectDir = new File(rootProject.projectDir, 'libs/secure-sm/src/main') - project(":libs:secure-sm").buildFileName = 'eclipse-build.gradle' - project(":libs:secure-sm-tests").projectDir = new File(rootProject.projectDir, 'libs/secure-sm/src/test') - project(":libs:secure-sm-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:grok").projectDir = new File(rootProject.projectDir, 'libs/grok/src/main') - project(":libs:grok").buildFileName = 'eclipse-build.gradle' - project(":libs:grok-tests").projectDir = new File(rootProject.projectDir, 'libs/grok/src/test') - project(":libs:grok-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:geo").projectDir = new File(rootProject.projectDir, 'libs/geo/src/main') - project(":libs:geo").buildFileName = 'eclipse-build.gradle' - project(":libs:geo-tests").projectDir = new File(rootProject.projectDir, 'libs/geo/src/test') - project(":libs:geo-tests").buildFileName = 'eclipse-build.gradle' - project(":libs:ssl-config").projectDir = new File(rootProject.projectDir, 'libs/ssl-config/src/main') - project(":libs:ssl-config").buildFileName = 'eclipse-build.gradle' - project(":libs:ssl-config-tests").projectDir = new File(rootProject.projectDir, 'libs/ssl-config/src/test') - project(":libs:ssl-config-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-core").projectDir = new File(rootProject.projectDir, 'libs/core/src/main') + project(":libs:elasticsearch-core").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-core-tests").projectDir = new File(rootProject.projectDir, 'libs/core/src/test') + project(":libs:elasticsearch-core-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-dissect").projectDir = new File(rootProject.projectDir, 'libs/dissect/src/main') + project(":libs:elasticsearch-dissect").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-dissect-tests").projectDir = new File(rootProject.projectDir, 'libs/dissect/src/test') + project(":libs:elasticsearch-dissect-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-nio").projectDir = new File(rootProject.projectDir, 'libs/nio/src/main') + project(":libs:elasticsearch-nio").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-nio-tests").projectDir = new File(rootProject.projectDir, 'libs/nio/src/test') + project(":libs:elasticsearch-nio-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-x-content").projectDir = new File(rootProject.projectDir, 'libs/x-content/src/main') + project(":libs:elasticsearch-x-content").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-x-content-tests").projectDir = new File(rootProject.projectDir, 'libs/x-content/src/test') + project(":libs:elasticsearch-x-content-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-secure-sm").projectDir = new File(rootProject.projectDir, 'libs/secure-sm/src/main') + project(":libs:elasticsearch-secure-sm").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-secure-sm-tests").projectDir = new File(rootProject.projectDir, 'libs/secure-sm/src/test') + project(":libs:elasticsearch-secure-sm-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-grok").projectDir = new File(rootProject.projectDir, 'libs/grok/src/main') + project(":libs:elasticsearch-grok").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-grok-tests").projectDir = new File(rootProject.projectDir, 'libs/grok/src/test') + project(":libs:elasticsearch-grok-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-geo").projectDir = new File(rootProject.projectDir, 'libs/geo/src/main') + project(":libs:elasticsearch-geo").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-geo-tests").projectDir = new File(rootProject.projectDir, 'libs/geo/src/test') + project(":libs:elasticsearch-geo-tests").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-ssl-config").projectDir = new File(rootProject.projectDir, 'libs/ssl-config/src/main') + project(":libs:elasticsearch-ssl-config").buildFileName = 'eclipse-build.gradle' + project(":libs:elasticsearch-ssl-config-tests").projectDir = new File(rootProject.projectDir, 'libs/ssl-config/src/test') + project(":libs:elasticsearch-ssl-config-tests").buildFileName = 'eclipse-build.gradle' } // look for extra plugins for elasticsearch @@ -163,7 +167,3 @@ if (extraProjects.exists()) { addSubProjects('', extraProjectDir) } } - -project(":libs:cli").name = 'elasticsearch-cli' -project(":libs:geo").name = 'elasticsearch-geo' -project(":libs:ssl-config").name = 'elasticsearch-ssl-config' diff --git a/test/framework/build.gradle b/test/framework/build.gradle index 18978bd2d7560..9cabdb82bf36a 100644 --- a/test/framework/build.gradle +++ b/test/framework/build.gradle @@ -18,11 +18,11 @@ */ dependencies { - compile "org.elasticsearch.client:elasticsearch-rest-client:${version}" - compile "org.elasticsearch.client:elasticsearch-rest-client-sniffer:${version}" - compile "org.elasticsearch:elasticsearch-nio:${version}" - compile "org.elasticsearch:elasticsearch:${version}" - compile "org.elasticsearch:elasticsearch-cli:${version}" + compile project(":client:rest") + compile project(":client:sniffer") + compile project(':libs:elasticsearch-nio') + compile project(":server") + compile project(":libs:elasticsearch-cli") compile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" compile "junit:junit:${versions.junit}" compile "org.hamcrest:hamcrest:${versions.hamcrest}" diff --git a/test/logger-usage/build.gradle b/test/logger-usage/build.gradle index 8e374d2cf6af7..0fa2ee3bfd9a4 100644 --- a/test/logger-usage/build.gradle +++ b/test/logger-usage/build.gradle @@ -20,7 +20,7 @@ dependencies { compile 'org.ow2.asm:asm-debug-all:5.0.4' // use asm-debug-all as asm-all is broken compile "org.apache.logging.log4j:log4j-api:${versions.log4j}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") } loggerUsageCheck.enabled = false diff --git a/x-pack/build.gradle b/x-pack/build.gradle index 9c90bbbbfc269..f9b13f07618ce 100644 --- a/x-pack/build.gradle +++ b/x-pack/build.gradle @@ -26,17 +26,3 @@ subprojects { project.ext.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt') project.ext.noticeFile = xpackRootProject.file('NOTICE.txt') } - -subprojects { - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ccr:${version}": xpackModule('ccr')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": xpackModule('core')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": xpackModule('deprecation')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": xpackModule('graph')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ilm:${version}": xpackModule('ilm')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-logstash:${version}": xpackModule('logstash')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ml:${version}": xpackModule('ml')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-monitoring:${version}": xpackModule('monitoring')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-security:${version}": xpackModule('security')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-sql:${version}": xpackModule('sql')] - ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": xpackModule('watcher')] -} diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle index efe08ff3b292d..1450012601d51 100644 --- a/x-pack/docs/build.gradle +++ b/x-pack/docs/build.gradle @@ -18,7 +18,6 @@ buildRestTests.expectedUnconvertedCandidates = [ ] dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') diff --git a/x-pack/license-tools/build.gradle b/x-pack/license-tools/build.gradle index 4bd17713a2fea..2a032dc0cd15a 100644 --- a/x-pack/license-tools/build.gradle +++ b/x-pack/license-tools/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'elasticsearch.build' dependencies { - compile "org.elasticsearch.plugin:x-pack-core:${version}" - compile "org.elasticsearch:elasticsearch:${version}" - testCompile "org.elasticsearch.test:framework:${version}" + compile project(':x-pack:plugin:core') + compile project(':server') + testCompile project(':test:framework') } project.forbiddenPatterns { diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 6ce71982f5b1d..0aa9767c4ff94 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -19,9 +19,7 @@ subprojects { // see the root Gradle file for additional logic regarding this configuration project.configurations.create('featureAwarePlugin') project.dependencies.add('featureAwarePlugin', project.configurations.compileClasspath) - project.dependencies.add( - 'featureAwarePlugin', - "org.elasticsearch.xpack.test:feature-aware:${org.elasticsearch.gradle.VersionProperties.elasticsearch}") + project.dependencies.add('featureAwarePlugin', project(':x-pack:test:feature-aware')) project.dependencies.add('featureAwarePlugin', project.sourceSets.main.output.getClassesDirs()) final Task featureAwareTask = project.tasks.create("featureAwareCheck", LoggedExec) { diff --git a/x-pack/plugin/ccr/build.gradle b/x-pack/plugin/ccr/build.gradle index a808a7197cccb..7f07db1d540fb 100644 --- a/x-pack/plugin/ccr/build.gradle +++ b/x-pack/plugin/ccr/build.gradle @@ -48,7 +48,7 @@ gradle.projectsEvaluated { } dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" + compileOnly project(":server") compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index 832b0af18fb1e..06c9e2c109a0e 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -23,7 +23,7 @@ dependencyLicenses { } dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" + compileOnly project(":server") compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" @@ -95,7 +95,7 @@ forbiddenApisMain { if (isEclipse) { // in eclipse the project is under a fake root, we need to change around the source sets sourceSets { - if (project.path == ":libs:core") { + if (project.path == ":libs:elasticsearch-core") { main.java.srcDirs = ['java'] main.resources.srcDirs = ['resources'] } else { diff --git a/x-pack/plugin/data-frame/build.gradle b/x-pack/plugin/data-frame/build.gradle index e065f72e99880..03c89994e97cf 100644 --- a/x-pack/plugin/data-frame/build.gradle +++ b/x-pack/plugin/data-frame/build.gradle @@ -9,7 +9,7 @@ esplugin { } dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" + compileOnly project(":server") compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/deprecation/build.gradle b/x-pack/plugin/deprecation/build.gradle index 62d2a891929a4..bbf235131d772 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(":x-pack:plugin:core") } integTest.enabled = false diff --git a/x-pack/plugin/graph/build.gradle b/x-pack/plugin/graph/build.gradle index e7b0b44fd659b..0b96516dd73e4 100644 --- a/x-pack/plugin/graph/build.gradle +++ b/x-pack/plugin/graph/build.gradle @@ -10,7 +10,6 @@ esplugin { archivesBaseName = 'x-pack-graph' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/graph/qa/with-security/build.gradle b/x-pack/plugin/graph/qa/with-security/build.gradle index f0f819b46d478..a79d72d0c7b55 100644 --- a/x-pack/plugin/graph/qa/with-security/build.gradle +++ b/x-pack/plugin/graph/qa/with-security/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") } // bring in graph rest test suite diff --git a/x-pack/plugin/ilm/build.gradle b/x-pack/plugin/ilm/build.gradle index e6962e3c3bf72..d29d9053de33a 100644 --- a/x-pack/plugin/ilm/build.gradle +++ b/x-pack/plugin/ilm/build.gradle @@ -13,7 +13,6 @@ esplugin { archivesBaseName = 'x-pack-ilm' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/logstash/build.gradle b/x-pack/plugin/logstash/build.gradle index 476d3f17cad41..aad286db95a94 100644 --- a/x-pack/plugin/logstash/build.gradle +++ b/x-pack/plugin/logstash/build.gradle @@ -10,7 +10,6 @@ esplugin { archivesBaseName = 'x-pack-logstash' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index 9bd4d445892e6..660a09c6b94a9 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -49,15 +49,14 @@ compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try, compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked" dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here + compileOnly project(':modules:lang-painless:spi') compileOnly project(path: xpackModule('core'), configuration: 'default') - compileOnly "org.elasticsearch.plugin:elasticsearch-scripting-painless-spi:${versions.elasticsearch}" testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // This should not be here testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') // ml deps - compile project(':libs:grok') + compile project(':libs:elasticsearch-grok') compile "com.ibm.icu:icu4j:${versions.icu4j}" compile "net.sf.supercsv:super-csv:${versions.supercsv}" nativeBundle "org.elasticsearch.ml:ml-cpp:${project.version}@zip" diff --git a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle index b47016c134459..fc27aa97d7a84 100644 --- a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle +++ b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") testCompile project(path: xpackModule('ml'), configuration: 'runtime') } diff --git a/x-pack/plugin/ml/qa/disabled/build.gradle b/x-pack/plugin/ml/qa/disabled/build.gradle index 2aa5d47acef0d..ee49189ae1a87 100644 --- a/x-pack/plugin/ml/qa/disabled/build.gradle +++ b/x-pack/plugin/ml/qa/disabled/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") testCompile project(path: xpackModule('ml'), configuration: 'runtime') } diff --git a/x-pack/plugin/ml/qa/ml-with-security/build.gradle b/x-pack/plugin/ml/qa/ml-with-security/build.gradle index bc0b0ca5b7b03..8d7f799d5a28a 100644 --- a/x-pack/plugin/ml/qa/ml-with-security/build.gradle +++ b/x-pack/plugin/ml/qa/ml-with-security/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index 22fd7837628b9..c6776156c940c 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('ml'), configuration: 'runtime') diff --git a/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle b/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle index 9eac3fdd37a80..1908fb8e0927d 100644 --- a/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle +++ b/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") testCompile project(path: xpackModule('ml'), configuration: 'runtime') } diff --git a/x-pack/plugin/ml/qa/single-node-tests/build.gradle b/x-pack/plugin/ml/qa/single-node-tests/build.gradle index f856c3d4c5ff4..a51e0a3141c0e 100644 --- a/x-pack/plugin/ml/qa/single-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/single-node-tests/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") testCompile project(path: xpackModule('ml'), configuration: 'runtime') } diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle index b2e0c930e0d61..6e45c830e2d92 100644 --- a/x-pack/plugin/monitoring/build.gradle +++ b/x-pack/plugin/monitoring/build.gradle @@ -10,18 +10,17 @@ esplugin { archivesBaseName = 'x-pack-monitoring' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // monitoring deps - compile "org.elasticsearch.client:elasticsearch-rest-client:${version}" - compile "org.elasticsearch.client:elasticsearch-rest-client-sniffer:${version}" + compile project(':client:rest') + compile project(':client:sniffer') // baz - this goes away after we separate out the actions #27759 - testCompile "org.elasticsearch.plugin:x-pack-watcher:${version}" + testCompile project(xpackModule('watcher')) - testCompile "org.elasticsearch.plugin:x-pack-ilm:${version}" + testCompile project(xpackModule('ilm')) } compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle index d159f3334b998..4650927ad8719 100644 --- a/x-pack/plugin/rollup/build.gradle +++ b/x-pack/plugin/rollup/build.gradle @@ -14,9 +14,8 @@ compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" - - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here + compileOnly project(":server") + compileOnly project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index e7e9c0fa71fa2..4bd70b8378378 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -13,7 +13,6 @@ esplugin { archivesBaseName = 'x-pack-security' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') 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 205815bda8c51..af4f0ce7ed15f 100644 --- a/x-pack/plugin/security/cli/build.gradle +++ b/x-pack/plugin/security/cli/build.gradle @@ -5,13 +5,12 @@ apply plugin: 'elasticsearch.build' archivesBaseName = 'elasticsearch-security-cli' dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here + compileOnly project(":server") compileOnly project(path: xpackModule('core'), configuration: 'default') compile "org.bouncycastle:bcpkix-jdk15on:${versions.bouncycastle}" compile "org.bouncycastle:bcprov-jdk15on:${versions.bouncycastle}" testImplementation 'com.google.jimfs:jimfs:1.1' - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/security/qa/basic-enable-security/build.gradle b/x-pack/plugin/security/qa/basic-enable-security/build.gradle index a21e3c68d3fc4..27532cfb7f155 100644 --- a/x-pack/plugin/security/qa/basic-enable-security/build.gradle +++ b/x-pack/plugin/security/qa/basic-enable-security/build.gradle @@ -4,7 +4,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/security/qa/security-basic/build.gradle b/x-pack/plugin/security/qa/security-basic/build.gradle index 864a1e5180934..e005aeb9e8cff 100644 --- a/x-pack/plugin/security/qa/security-basic/build.gradle +++ b/x-pack/plugin/security/qa/security-basic/build.gradle @@ -4,7 +4,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/security/qa/tls-basic/build.gradle b/x-pack/plugin/security/qa/tls-basic/build.gradle index 9f5ef26f6e6a6..78c67daf72951 100644 --- a/x-pack/plugin/security/qa/tls-basic/build.gradle +++ b/x-pack/plugin/security/qa/tls-basic/build.gradle @@ -4,7 +4,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle index b996f069b4c54..c828f7e346b02 100644 --- a/x-pack/plugin/sql/build.gradle +++ b/x-pack/plugin/sql/build.gradle @@ -38,16 +38,15 @@ task internalClusterTest(type: Test) { check.dependsOn internalClusterTest dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here compileOnly project(path: xpackModule('core'), configuration: 'default') compileOnly(project(':modules:lang-painless')) { // exclude ASM to not affect featureAware task on Java 10+ exclude group: "org.ow2.asm" } compile project('sql-action') - compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}" + compile project(':modules:aggs-matrix-stats') compile "org.antlr:antlr4-runtime:4.5.3" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(':test:framework') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: ':modules:reindex', configuration: 'runtime') diff --git a/x-pack/plugin/sql/jdbc/build.gradle b/x-pack/plugin/sql/jdbc/build.gradle index 22186976d6f42..fe85cb473e355 100644 --- a/x-pack/plugin/sql/jdbc/build.gradle +++ b/x-pack/plugin/sql/jdbc/build.gradle @@ -18,15 +18,15 @@ dependencies { compile (xpackProject('plugin:sql:sql-proto')) { transitive = false } - compile (project(':libs:x-content')) { + compile (project(':libs:elasticsearch-x-content')) { transitive = false } compile (project(':libs:elasticsearch-geo')) { transitive = false } - compile project(':libs:core') + compile project(':libs:elasticsearch-core') runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } diff --git a/x-pack/plugin/sql/qa/build.gradle b/x-pack/plugin/sql/qa/build.gradle index f2a6acd61a058..14bc1faa3fa43 100644 --- a/x-pack/plugin/sql/qa/build.gradle +++ b/x-pack/plugin/sql/qa/build.gradle @@ -6,7 +6,7 @@ archivesBaseName = 'qa-sql' group = "org.elasticsearch.x-pack.qa.sql" dependencies { - compile "org.elasticsearch.test:framework:${version}" + compile project(":test:framework") // JDBC testing dependencies compile project(path: xpackModule('sql:jdbc'), configuration: 'nodeps') @@ -59,7 +59,7 @@ subprojects { testCompile(xpackProject('plugin:sql:qa')) { transitive = false } - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") // JDBC testing dependencies testRuntime "net.sourceforge.csvjdbc:csvjdbc:${csvjdbcVersion}" diff --git a/x-pack/plugin/sql/qa/security/build.gradle b/x-pack/plugin/sql/qa/security/build.gradle index a0e6e82ed4d67..33a4963c10376 100644 --- a/x-pack/plugin/sql/qa/security/build.gradle +++ b/x-pack/plugin/sql/qa/security/build.gradle @@ -1,5 +1,5 @@ dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') } Project mainProject = project @@ -26,7 +26,7 @@ subprojects { } dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(":x-pack:plugin:core") } integTestCluster { diff --git a/x-pack/plugin/sql/sql-action/build.gradle b/x-pack/plugin/sql/sql-action/build.gradle index 86a028186f441..defbf3dac852e 100644 --- a/x-pack/plugin/sql/sql-action/build.gradle +++ b/x-pack/plugin/sql/sql-action/build.gradle @@ -13,10 +13,10 @@ dependencies { compile (project(':server')) { transitive = false } - compile (project(':libs:core')) { + compile (project(':libs:elasticsearch-core')) { transitive = false } - compile (project(':libs:x-content')) { + compile (project(':libs:elasticsearch-x-content')) { transitive = false } compile xpackProject('plugin:sql:sql-proto') @@ -26,7 +26,7 @@ dependencies { runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}" runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") } forbiddenApisMain { diff --git a/x-pack/plugin/sql/sql-cli/build.gradle b/x-pack/plugin/sql/sql-cli/build.gradle index 6f57ea279c5ab..927d165c2d268 100644 --- a/x-pack/plugin/sql/sql-cli/build.gradle +++ b/x-pack/plugin/sql/sql-cli/build.gradle @@ -25,10 +25,10 @@ dependencies { compile xpackProject('plugin:sql:sql-client') compile xpackProject('plugin:sql:sql-action') - compile "org.elasticsearch:elasticsearch-cli:${version}" + compile project(":libs:elasticsearch-cli") runtime "org.elasticsearch:jna:${versions.jna}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") } dependencyLicenses { diff --git a/x-pack/plugin/sql/sql-client/build.gradle b/x-pack/plugin/sql/sql-client/build.gradle index 613ca73a4dbad..cc6f097880e38 100644 --- a/x-pack/plugin/sql/sql-client/build.gradle +++ b/x-pack/plugin/sql/sql-client/build.gradle @@ -10,7 +10,7 @@ description = 'Code shared between jdbc and cli' dependencies { compile xpackProject('plugin:sql:sql-proto') compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") } dependencyLicenses { diff --git a/x-pack/plugin/sql/sql-proto/build.gradle b/x-pack/plugin/sql/sql-proto/build.gradle index b1c055a0dfcb8..af890d82968e3 100644 --- a/x-pack/plugin/sql/sql-proto/build.gradle +++ b/x-pack/plugin/sql/sql-proto/build.gradle @@ -8,15 +8,15 @@ description = 'Request and response objects shared by the cli, jdbc ' + 'and the Elasticsearch plugin' dependencies { - compile (project(':libs:core')) { + compile (project(':libs:elasticsearch-core')) { transitive = false } - compile (project(':libs:x-content')) { + compile (project(':libs:elasticsearch-x-content')) { transitive = false } runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile "org.elasticsearch.test:framework:${version}" + testCompile project(":test:framework") } forbiddenApisMain { diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index e236b75ee2c74..806c79064897c 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -23,15 +23,13 @@ dependencyLicenses { } dependencies { - compileOnly "org.elasticsearch:elasticsearch:${version}" - - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here + compileOnly project(':server') compileOnly project(path: xpackModule('core'), configuration: 'default') compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime') compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile "org.elasticsearch.plugin:x-pack-ilm:${version}" + testCompile xpackModule('ilm') // watcher deps compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239' diff --git a/x-pack/qa/kerberos-tests/build.gradle b/x-pack/qa/kerberos-tests/build.gradle index 88248f89b72c5..8f3268aa9fdea 100644 --- a/x-pack/qa/kerberos-tests/build.gradle +++ b/x-pack/qa/kerberos-tests/build.gradle @@ -12,7 +12,7 @@ testFixtures.useFixture ":test:fixtures:krb5kdc-fixture" integTest.enabled = false dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') } diff --git a/x-pack/qa/oidc-op-tests/build.gradle b/x-pack/qa/oidc-op-tests/build.gradle index 52e581f60a580..7b053d9da6341 100644 --- a/x-pack/qa/oidc-op-tests/build.gradle +++ b/x-pack/qa/oidc-op-tests/build.gradle @@ -5,7 +5,6 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') diff --git a/x-pack/qa/openldap-tests/build.gradle b/x-pack/qa/openldap-tests/build.gradle index 5305699b9a0c7..9fc5a9b3b31a8 100644 --- a/x-pack/qa/openldap-tests/build.gradle +++ b/x-pack/qa/openldap-tests/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle index b0ae65b344845..d831707a996d1 100644 --- a/x-pack/qa/reindex-tests-with-security/build.gradle +++ b/x-pack/qa/reindex-tests-with-security/build.gradle @@ -4,7 +4,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index 471503e385d5e..2f567b5cfdc9c 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -11,7 +11,7 @@ test.enabled = false dependencies { testCompile project(':x-pack:qa') - testCompile ("org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}") + testCompile project(':client:rest-high-level') } Closure waitWithAuth = { NodeInfo node, AntBuilder ant -> diff --git a/x-pack/qa/security-example-spi-extension/build.gradle b/x-pack/qa/security-example-spi-extension/build.gradle index 1ff65519c367d..f997f9cb871fc 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 "org.elasticsearch.plugin:x-pack-core:${version}" + compileOnly project(':x-pack:plugin:core') 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 a99fa2d543861..2cca5f40b8c7a 100644 --- a/x-pack/qa/security-setup-password-tests/build.gradle +++ b/x-pack/qa/security-setup-password-tests/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - // "org.elasticsearch.plugin:x-pack-core:${version}" doesn't work with idea because the testArtifacts are also here testCompile project(path: xpackModule('core'), configuration: 'default') testCompile project(path: xpackModule('security'), configuration: 'runtime') testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/qa/smoke-test-plugins-ssl/build.gradle b/x-pack/qa/smoke-test-plugins-ssl/build.gradle index e88eac3028f3d..da448691dfc41 100644 --- a/x-pack/qa/smoke-test-plugins-ssl/build.gradle +++ b/x-pack/qa/smoke-test-plugins-ssl/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') } String outputDir = "${buildDir}/generated-resources/${project.name}" diff --git a/x-pack/qa/third-party/jira/build.gradle b/x-pack/qa/third-party/jira/build.gradle index 43667300a3383..c01f6f129b9b1 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 "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') 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 9013d8c281538..69c9848447044 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 "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') 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 9fdfaeb826667..956631714c040 100644 --- a/x-pack/qa/third-party/slack/build.gradle +++ b/x-pack/qa/third-party/slack/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile "org.elasticsearch.plugin:x-pack-core:${version}" + testCompile project(':x-pack:plugin:core') testCompile project(path: xpackModule('watcher'), configuration: 'runtime') } diff --git a/x-pack/test/feature-aware/build.gradle b/x-pack/test/feature-aware/build.gradle index e3c7ae96063d0..9d7f1504418d2 100644 --- a/x-pack/test/feature-aware/build.gradle +++ b/x-pack/test/feature-aware/build.gradle @@ -2,9 +2,9 @@ apply plugin: 'elasticsearch.build' dependencies { compile 'org.ow2.asm:asm:7.1' - compile "org.elasticsearch:elasticsearch:${version}" - compile "org.elasticsearch.plugin:x-pack-core:${version}" - testCompile "org.elasticsearch.test:framework:${version}" + compile project(':server') + compile project(':x-pack:plugin:core') + testCompile project(':test:framework') } forbiddenApisMain.enabled = true