Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix project artifact sharing. #1442

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions hive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,38 @@ description = "Elasticsearch Hadoop Hive"

evaluationDependsOn(':elasticsearch-hadoop-mr')

configurations {
embedded {
transitive = false
canBeResolved = true
}
implementation {
extendsFrom project.configurations.embedded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should change the canBeResolved for the implementation configuration. See https://discuss.gradle.org/t/what-is-a-configuration-which-cant-be-directly-resolved/30721/2

In short, you should never change the canBeConsumed and canBeResolved flags of configuration you do not create.

also, it's not clear you are changing it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation shouldn't be affected by that at all. Only the embedded configuration is getting canBeResolved set on it. The implementation configuration just depends on it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , i mis-understood how extendsFrom behaves

}
}

dependencies {
provided(project(":elasticsearch-hadoop-mr"))
provided(project(path: ":elasticsearch-hadoop-mr", configuration:"compile"))
embedded(project(":elasticsearch-hadoop-mr"))

provided("org.apache.hive:hive-service:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
provided("org.apache.hive:hive-exec:$hiveVersion")
provided("org.apache.hive:hive-metastore:$hiveVersion")

testImplementation(project(":test:shared"))

itestImplementation(project(":test:shared"))
itestImplementation("org.apache.hive:hive-service:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
itestImplementation("org.apache.hive:hive-jdbc:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
}

jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
Expand All @@ -29,18 +51,3 @@ javadoc {
sourcesJar {
from project(":elasticsearch-hadoop-mr").sourceSets.main.allJava.srcDirs
}

dependencies {
provided("org.apache.hive:hive-service:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
provided("org.apache.hive:hive-exec:$hiveVersion")
provided("org.apache.hive:hive-metastore:$hiveVersion")

itestImplementation("org.apache.hive:hive-service:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
itestImplementation("org.apache.hive:hive-jdbc:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
}
41 changes: 23 additions & 18 deletions pig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,36 @@ description = "Elasticsearch Hadoop Pig"

evaluationDependsOn(':elasticsearch-hadoop-mr')

configurations {
embedded {
transitive = false
canBeResolved = true
}
implementation {
extendsFrom project.configurations.embedded
}
}

ext.pigClassifier = "h2"

dependencies {
provided(project(":elasticsearch-hadoop-mr"))
provided(project(path: ":elasticsearch-hadoop-mr", configuration:"compile"))
embedded(project(":elasticsearch-hadoop-mr"))

provided("org.apache.pig:pig:$pigVersion:$pigClassifier")
provided("joda-time:joda-time:$jodaVersion")

testImplementation(project(":test:shared"))
testImplementation("org.apache.pig:pig:$pigVersion:$pigClassifier")
testImplementation("joda-time:joda-time:$jodaVersion")
testImplementation("com.google.guava:guava:11.0")
testImplementation("jline:jline:0.9.94")

itestImplementation(project(":test:shared"))
itestImplementation("dk.brics.automaton:automaton:1.11-8")
}

jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
Expand All @@ -29,18 +49,3 @@ javadoc {
sourcesJar {
from project(":elasticsearch-hadoop-mr").sourceSets.main.allJava.srcDirs
}

ext.pigClassifier = "h2"

dependencies {
provided("org.apache.pig:pig:$pigVersion:$pigClassifier")
provided("joda-time:joda-time:$jodaVersion")

testImplementation("org.apache.pig:pig:$pigVersion:$pigClassifier")
testImplementation("joda-time:joda-time:$jodaVersion")

testImplementation("com.google.guava:guava:11.0")
testImplementation("jline:jline:0.9.94")

itestImplementation("dk.brics.automaton:automaton:1.11-8")
}
55 changes: 30 additions & 25 deletions spark/sql-13/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,42 @@ variants {
targetVersions '2.11.12'
}

println "Compiled using Scala ${project.ext.scalaMajorVersion} [${project.ext.scalaVersion}]"
String sparkVersion = spark13Version

configurations {
embedded {
transitive = false
canBeResolved = true
}
implementation {
extendsFrom project.configurations.embedded
}
scalaCompilerPlugin {
defaultDependencies { dependencies ->
dependencies.add(project.dependencies.create( "com.typesafe.genjavadoc:genjavadoc-plugin_${scalaVersion}:0.13"))
}
}
testImplementation {
exclude group: "org.mortbay.jetty"
}
itestImplementation {
exclude group: "org.mortbay.jetty"
}
}

println "Compiled using Scala ${project.ext.scalaMajorVersion} [${project.ext.scalaVersion}]"
String sparkVersion = spark13Version
// deal with the messy conflicts out there
configurations.all { Configuration conf ->
conf.resolutionStrategy {
eachDependency { details ->
// in a similar vein, change all javax.servlet artifacts to the one used by Spark
// otherwise these will lead to SecurityException (signer information wrong)
if (details.requested.name.contains("servlet") && !details.requested.name.contains("guice")) {
details.useTarget group: "org.eclipse.jetty.orbit", name: "javax.servlet", version: "3.0.0.v201112011016"
}
}
}
}

tasks.withType(ScalaCompile) { ScalaCompile task ->
task.sourceCompatibility = project.ext.minimumRuntimeVersion
Expand Down Expand Up @@ -88,7 +114,7 @@ eclipse {
}

dependencies {
provided(project(":elasticsearch-hadoop-mr"))
embedded(project(":elasticsearch-hadoop-mr"))

api("org.scala-lang:scala-library:${project.ext.scalaVersion}")
api("org.scala-lang:scala-reflect:${project.ext.scalaVersion}")
Expand Down Expand Up @@ -138,7 +164,7 @@ dependencies {
}

jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
Expand All @@ -160,27 +186,6 @@ scaladoc {
title = "${rootProject.description} ${version} API"
}

// deal with the messy conflicts out there
configurations.all { Configuration conf ->
conf.resolutionStrategy {
eachDependency { details ->
// in a similar vein, change all javax.servlet artifacts to the one used by Spark
// otherwise these will lead to SecurityException (signer information wrong)
if (details.requested.name.contains("servlet") && !details.requested.name.contains("guice")) {
details.useTarget group: "org.eclipse.jetty.orbit", name: "javax.servlet", version: "3.0.0.v201112011016"
}
}
}
}
configurations {
testImplementation {
exclude group: "org.mortbay.jetty"
}
itestImplementation {
exclude group: "org.mortbay.jetty"
}
}

tasks.withType(ScalaCompile) {
scalaCompileOptions.with {
additionalParameters = [
Expand Down
11 changes: 9 additions & 2 deletions spark/sql-20/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ variants {
}

configurations {
embedded {
transitive = false
canBeResolved = true
}
implementation {
extendsFrom project.configurations.embedded
}
scalaCompilerPlugin {
defaultDependencies { dependencies ->
dependencies.add(project.dependencies.create( "com.typesafe.genjavadoc:genjavadoc-plugin_${scalaVersion}:0.13"))
Expand Down Expand Up @@ -93,7 +100,7 @@ eclipse {
}

dependencies {
provided(project(":elasticsearch-hadoop-mr"))
embedded(project(":elasticsearch-hadoop-mr"))

api("org.scala-lang:scala-library:$scalaVersion")
api("org.scala-lang:scala-reflect:$scalaVersion")
Expand Down Expand Up @@ -152,7 +159,7 @@ dependencies {
}

jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
Expand Down
33 changes: 19 additions & 14 deletions storm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,32 @@ description = "Elasticsearch Storm"

evaluationDependsOn(':elasticsearch-hadoop-mr')

configurations {
embedded {
transitive = false
canBeResolved = true
}
implementation {
extendsFrom project.configurations.embedded
}
}

dependencies {
provided(project(":elasticsearch-hadoop-mr"))
embedded(project(":elasticsearch-hadoop-mr"))

provided("org.apache.storm:storm-core:$stormVersion") {
exclude module: "log4j-slf4j-impl"
}

testImplementation(project(":test:shared"))

itestImplementation(project(":test:shared"))
itestImplementation("com.google.guava:guava:16.0.1")
itestImplementation("com.twitter:carbonite:1.4.0")
}

jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
Expand All @@ -29,16 +46,4 @@ sourcesJar {
from project(":elasticsearch-hadoop-mr").sourceSets.main.allJava.srcDirs
}

dependencies {
provided("org.apache.storm:storm-core:$stormVersion") {
exclude module: "log4j-slf4j-impl"
}

itestImplementation("com.google.guava:guava:16.0.1")
itestImplementation("com.twitter:carbonite:1.4.0")
}

// add itest to Eclipse
//eclipse.classpath.plusConfigurations += [configurations.itestCompile]

tasks.getByName('integrationTest').enabled = false