Browse Source

Remove unnecessary usage of Gradle dependency substitution rules (#42773)

Mark Vieira 6 years ago
parent
commit
12d583dbf6
90 changed files with 274 additions and 359 deletions
  1. 1 1
      benchmarks/build.gradle
  2. 4 65
      build.gradle
  3. 5 0
      buildSrc/build.gradle
  4. 8 2
      buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy
  5. 21 17
      buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy
  6. 1 1
      buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy
  7. 1 1
      buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy
  8. 23 0
      buildSrc/src/main/java/org/elasticsearch/gradle/tool/ClasspathUtils.java
  9. 0 0
      buildSrc/src/main/resources/buildSrc.marker
  10. 3 3
      client/benchmark/build.gradle
  11. 9 9
      client/rest-high-level/build.gradle
  12. 2 2
      client/rest/build.gradle
  13. 3 3
      client/sniffer/build.gradle
  14. 1 1
      client/test/build.gradle
  15. 7 7
      client/transport/build.gradle
  16. 1 1
      distribution/build.gradle
  17. 3 3
      distribution/tools/keystore-cli/build.gradle
  18. 3 3
      distribution/tools/plugin-cli/build.gradle
  19. 5 5
      libs/build.gradle
  20. 1 1
      libs/cli/build.gradle
  21. 4 14
      libs/core/build.gradle
  22. 6 8
      libs/dissect/build.gradle
  23. 3 3
      libs/geo/build.gradle
  24. 4 6
      libs/grok/build.gradle
  25. 4 14
      libs/nio/build.gradle
  26. 4 14
      libs/secure-sm/build.gradle
  27. 4 4
      libs/ssl-config/build.gradle
  28. 4 14
      libs/x-content/build.gradle
  29. 2 2
      modules/ingest-common/build.gradle
  30. 1 1
      modules/lang-painless/build.gradle
  31. 1 1
      modules/lang-painless/spi/build.gradle
  32. 2 2
      modules/reindex/build.gradle
  33. 19 0
      plugins/examples/build.gradle
  34. 1 1
      plugins/transport-nio/build.gradle
  35. 1 1
      qa/ccs-unavailable-clusters/build.gradle
  36. 1 1
      qa/multi-cluster-search/build.gradle
  37. 1 1
      qa/vagrant/build.gradle
  38. 2 2
      qa/wildfly/build.gradle
  39. 9 9
      server/build.gradle
  40. 1 1
      server/src/main/resources/org/elasticsearch/bootstrap/security.policy
  41. 36 36
      settings.gradle
  42. 5 5
      test/framework/build.gradle
  43. 1 1
      test/logger-usage/build.gradle
  44. 0 14
      x-pack/build.gradle
  45. 0 1
      x-pack/docs/build.gradle
  46. 3 3
      x-pack/license-tools/build.gradle
  47. 1 3
      x-pack/plugin/build.gradle
  48. 1 1
      x-pack/plugin/ccr/build.gradle
  49. 3 3
      x-pack/plugin/core/build.gradle
  50. 1 1
      x-pack/plugin/data-frame/build.gradle
  51. 1 1
      x-pack/plugin/deprecation/build.gradle
  52. 0 1
      x-pack/plugin/graph/build.gradle
  53. 1 1
      x-pack/plugin/graph/qa/with-security/build.gradle
  54. 0 1
      x-pack/plugin/ilm/build.gradle
  55. 0 1
      x-pack/plugin/logstash/build.gradle
  56. 2 3
      x-pack/plugin/ml/build.gradle
  57. 1 1
      x-pack/plugin/ml/qa/basic-multi-node/build.gradle
  58. 1 1
      x-pack/plugin/ml/qa/disabled/build.gradle
  59. 0 1
      x-pack/plugin/ml/qa/ml-with-security/build.gradle
  60. 0 1
      x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle
  61. 1 1
      x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle
  62. 1 1
      x-pack/plugin/ml/qa/single-node-tests/build.gradle
  63. 4 5
      x-pack/plugin/monitoring/build.gradle
  64. 2 3
      x-pack/plugin/rollup/build.gradle
  65. 0 1
      x-pack/plugin/security/build.gradle
  66. 2 3
      x-pack/plugin/security/cli/build.gradle
  67. 0 1
      x-pack/plugin/security/qa/basic-enable-security/build.gradle
  68. 0 1
      x-pack/plugin/security/qa/security-basic/build.gradle
  69. 0 1
      x-pack/plugin/security/qa/tls-basic/build.gradle
  70. 2 3
      x-pack/plugin/sql/build.gradle
  71. 3 3
      x-pack/plugin/sql/jdbc/build.gradle
  72. 2 2
      x-pack/plugin/sql/qa/build.gradle
  73. 2 2
      x-pack/plugin/sql/qa/security/build.gradle
  74. 3 3
      x-pack/plugin/sql/sql-action/build.gradle
  75. 2 2
      x-pack/plugin/sql/sql-cli/build.gradle
  76. 1 1
      x-pack/plugin/sql/sql-client/build.gradle
  77. 3 3
      x-pack/plugin/sql/sql-proto/build.gradle
  78. 2 4
      x-pack/plugin/watcher/build.gradle
  79. 1 1
      x-pack/qa/kerberos-tests/build.gradle
  80. 0 1
      x-pack/qa/oidc-op-tests/build.gradle
  81. 0 1
      x-pack/qa/openldap-tests/build.gradle
  82. 0 1
      x-pack/qa/reindex-tests-with-security/build.gradle
  83. 1 1
      x-pack/qa/rolling-upgrade/build.gradle
  84. 2 2
      x-pack/qa/security-example-spi-extension/build.gradle
  85. 0 1
      x-pack/qa/security-setup-password-tests/build.gradle
  86. 1 1
      x-pack/qa/smoke-test-plugins-ssl/build.gradle
  87. 1 1
      x-pack/qa/third-party/jira/build.gradle
  88. 1 1
      x-pack/qa/third-party/pagerduty/build.gradle
  89. 1 1
      x-pack/qa/third-party/slack/build.gradle
  90. 3 3
      x-pack/test/feature-aware/build.gradle

+ 1 - 1
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'

+ 4 - 65
build.gradle

@@ -209,68 +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'
-  ]
-
-  /*
-   * 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
@@ -279,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
         }
@@ -338,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

+ 5 - 0
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) {

+ 8 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

@@ -26,6 +26,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
@@ -136,8 +137,13 @@ class PluginBuildPlugin implements Plugin<Project> {
 
     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}"

+ 21 - 17
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<Task> 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
         }

+ 1 - 1
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

@@ -252,7 +252,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) {

+ 1 - 1
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy

@@ -79,7 +79,7 @@ class StandaloneRestTestPlugin implements Plugin<Project> {
 
         // 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]

+ 23 - 0
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;
+    }
+}

+ 0 - 0
buildSrc/src/main/resources/buildSrc.marker


+ 3 - 3
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')

+ 9 - 9
client/rest-high-level/build.gradle

@@ -46,34 +46,34 @@ idea {
 }
 
 dependencies {
-  compile "org.elasticsearch:elasticsearch:${version}"
-  compile "org.elasticsearch.client:elasticsearch-rest-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')
-  shadow "org.elasticsearch:elasticsearch:${version}"
-  shadow "org.elasticsearch.client:elasticsearch-rest-client:${version}"
+  shadow project(':server')
+  shadow project(':client:rest')
   bundle project(':modules:parent-join')
   bundle project(':modules:aggs-matrix-stats')
   bundle project(':modules:rank-eval')
   bundle 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}"
+  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)
   if (isEclipse == false || project.path == ":client:rest-high-level-tests") {
-    testCompile("org.elasticsearch.plugin:x-pack-core:${version}") {
+    testCompile(project(':x-pack:plugin:core')) {
         exclude group: 'org.elasticsearch', module: 'elasticsearch-rest-high-level-client'
     }
   }
 
-  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)

+ 2 - 2
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 {

+ 3 - 3
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 {

+ 1 - 1
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?

+ 7 - 7
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}"

+ 1 - 1
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') {

+ 3 - 3
distribution/tools/keystore-cli/build.gradle

@@ -20,9 +20,9 @@
 apply plugin: 'elasticsearch.build'
 
 dependencies {
-  compileOnly "org.elasticsearch:elasticsearch:${version}"
-  compileOnly "org.elasticsearch:elasticsearch-cli:${version}"
-  testCompile "org.elasticsearch.test:framework:${version}"
+  compileOnly project(":server")
+  compileOnly project(":libs:elasticsearch-cli")
+  testCompile project(":test:framework")
   testCompile 'com.google.jimfs:jimfs:1.1'
   testCompile 'com.google.guava:guava:18.0'
 }

+ 3 - 3
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'
 }

+ 5 - 5
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}")
                 }
             }

+ 1 - 1
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

+ 4 - 14
libs/core/build.gradle

@@ -21,30 +21,20 @@ apply plugin: 'nebula.optional-base'
 apply plugin: 'nebula.maven-base-publish'
 apply plugin: 'nebula.maven-scm'
 
-archivesBaseName = 'elasticsearch-core'
-
-publishing {
-    publications {
-        nebula {
-            artifactId = archivesBaseName
-        }
-    }
-}
-
 dependencies {
     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:core-tests") {
-        testCompile("org.elasticsearch.test:framework:${version}") {
+    if (isEclipse == false || project.path == ":libs:elasticsearch-core-tests") {
+        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'
 }
@@ -52,7 +42,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 {

+ 6 - 8
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 {

+ 3 - 3
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 {

+ 4 - 6
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 {

+ 4 - 14
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 {

+ 4 - 14
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 {

+ 4 - 4
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 {

+ 4 - 14
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 {

+ 2 - 2
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')
 }

+ 1 - 1
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')
 }
 

+ 1 - 1
modules/lang-painless/spi/build.gradle

@@ -33,7 +33,7 @@ publishing {
 }
 
 dependencies {
-  compile "org.elasticsearch:elasticsearch:${version}"
+  compile project(":server")
 }
 
 // no tests...yet?

+ 2 - 2
modules/reindex/build.gradle

@@ -54,8 +54,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

+ 19 - 0
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')
+        }
+    }
+}

+ 1 - 1
plugins/transport-nio/build.gradle

@@ -24,7 +24,7 @@ esplugin {
 }
 
 dependencies {
-    compile "org.elasticsearch:elasticsearch-nio:${version}"
+    compile project(':libs:elasticsearch-nio')
 
     // network stack
     compile "io.netty:netty-buffer:${versions.netty}"

+ 1 - 1
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")
 }

+ 1 - 1
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) {

+ 1 - 1
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')

+ 2 - 2
qa/wildfly/build.gradle

@@ -70,9 +70,9 @@ dependencies {
     compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
     compile "org.apache.logging.log4j:log4j-api:${versions.log4j}"
     compile "org.apache.logging.log4j:log4j-core:${versions.log4j}"
-    compile project(path: ':client:rest-high-level')
+    compile project(':client:rest-high-level')
     wildfly "org.jboss:wildfly:${wildflyVersion}@zip"
-    testCompile "org.elasticsearch.test:framework:${VersionProperties.elasticsearch}"
+    testCompile project(':test:framework')
 }
 
 task unzipWildfly(type: Sync) {

+ 9 - 9
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'
     }
   }
 }

+ 1 - 1
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";
 };

+ 36 - 36
settings.gradle

@@ -120,43 +120,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'
   project(":client:rest-high-level").projectDir = new File(rootProject.projectDir, 'client/rest-high-level/src/main')
   project(":client:rest-high-level").buildFileName = 'eclipse-build.gradle'
   project(":client:rest-high-level-tests").projectDir = new File(rootProject.projectDir, 'client/rest-high-level/src/test')
@@ -175,7 +179,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'

+ 5 - 5
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}"

+ 1 - 1
test/logger-usage/build.gradle

@@ -22,7 +22,7 @@ dependencies {
   compile 'org.ow2.asm:asm-tree:7.1'
   compile 'org.ow2.asm:asm-analysis:7.1'
   compile "org.apache.logging.log4j:log4j-api:${versions.log4j}"
-  testCompile "org.elasticsearch.test:framework:${version}"
+  testCompile project(":test:framework")
 }
 
 loggerUsageCheck.enabled = false

+ 0 - 14
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')]
-}

+ 0 - 1
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')
     if (isEclipse) {

+ 3 - 3
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 {

+ 1 - 3
x-pack/plugin/build.gradle

@@ -22,9 +22,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) {

+ 1 - 1
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')

+ 3 - 3
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}"
@@ -49,7 +49,7 @@ dependencies {
     testCompile project(path: ':modules:parent-join', configuration: 'runtime')
     testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
     testCompile project(path: ':modules:analysis-common', configuration: 'runtime')
-    testCompile ("org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}")
+    testCompile project(":client:rest-high-level")
 
     if (isEclipse == false || project.path == ":x-pack:plugin:core-tests") {
       testCompile(project(':x-pack:license-tools')) {
@@ -103,7 +103,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 {

+ 1 - 1
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')

+ 1 - 1
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

+ 0 - 1
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')
     if (isEclipse) {

+ 1 - 1
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

+ 0 - 1
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')
     if (isEclipse) {

+ 0 - 1
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')
     if (isEclipse) {

+ 2 - 3
x-pack/plugin/ml/build.gradle

@@ -49,9 +49,8 @@ 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')
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')
@@ -60,7 +59,7 @@ dependencies {
     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"

+ 1 - 1
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')
 }
 

+ 1 - 1
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')
 }
 

+ 0 - 1
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')
   if (isEclipse) {

+ 0 - 1
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')
     if (isEclipse) {

+ 1 - 1
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')
 }

+ 1 - 1
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')
 }
 

+ 4 - 5
x-pack/plugin/monitoring/build.gradle

@@ -10,7 +10,6 @@ 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')
     if (isEclipse) {
@@ -18,13 +17,13 @@ dependencies {
     }
 
     // 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"

+ 2 - 3
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')
     if (isEclipse) {

+ 0 - 1
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')

+ 2 - 3
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')
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')

+ 0 - 1
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')

+ 0 - 1
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')

+ 0 - 1
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')

+ 2 - 3
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')
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')

+ 3 - 3
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')
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')

+ 2 - 2
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}"

+ 2 - 2
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 {

+ 3 - 3
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 {

+ 2 - 2
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 {

+ 1 - 1
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 {

+ 3 - 3
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 {

+ 2 - 4
x-pack/plugin/watcher/build.gradle

@@ -23,9 +23,7 @@ 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')
@@ -34,7 +32,7 @@ dependencies {
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')
     }
-    testCompile "org.elasticsearch.plugin:x-pack-ilm:${version}"
+    testCompile project(xpackModule('ilm'))
 
     // watcher deps
     compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239'

+ 1 - 1
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')
     if (isEclipse) {
       testCompile project(path: xpackModule('core-tests'), configuration: 'testArtifacts')

+ 0 - 1
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')
     if (isEclipse) {

+ 0 - 1
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')

+ 0 - 1
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')

+ 1 - 1
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 ->

+ 2 - 2
x-pack/qa/security-example-spi-extension/build.gradle

@@ -8,8 +8,8 @@ esplugin {
 }
 
 dependencies {
-  compileOnly "org.elasticsearch.plugin:x-pack-core:${version}"
-  testCompile "org.elasticsearch.client:elasticsearch-rest-high-level-client:${version}"
+  compileOnly project(':x-pack:plugin:core')
+  testCompile project(':client:rest-high-level')
 }
 
 

+ 0 - 1
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')

+ 1 - 1
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')
   testCompile project(':client:rest-high-level')
 }
 

+ 1 - 1
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')
 }
 

+ 1 - 1
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')
 }
 

+ 1 - 1
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')
 }
 

+ 3 - 3
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