Skip to content

Commit

Permalink
Fix missing service files in ES-Hadoop jars (elastic#1265)
Browse files Browse the repository at this point in the history
This PR ensures that the contents of the mr project's META-INF/services directory are 
copied into the hive, pig, spark, and storm jars, and that the contents of all of integrations 
META-INF/services directories are copied into the root elasticsearch-hadoop jar.
  • Loading branch information
jbaiera committed Mar 19, 2019
1 parent a31401e commit 736d484
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ class BuildPlugin implements Plugin<Project> {
private static String gitHash(File gitHead) {
String rev = "unknown"

if (gitHead.exists()) {
if (gitHead != null && gitHead.exists()) {
rev = gitHead.text.trim()
}
return rev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class IntegrationBuildPlugin implements Plugin<Project> {
Jar rootJar = project.rootProject.getTasks().getByName('jar') as Jar
rootJar.dependsOn(project.tasks.jar)
rootJar.from(project.zipTree(project.tasks.jar.archivePath)) {
exclude "META-INF/**"
exclude "META-INF/*"
include "META-INF/services"
include "**/*"
}

Expand Down
3 changes: 2 additions & 1 deletion hive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
}
}

Expand All @@ -37,4 +38,4 @@ dependencies {
itestRuntime("org.apache.hive:hive-jdbc:$hiveVersion") {
exclude module: "log4j-slf4j-impl"
}
}
}
3 changes: 2 additions & 1 deletion pig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
}
}

Expand All @@ -39,4 +40,4 @@ dependencies {
testRuntime "jline:jline:0.9.94"

itestRuntime "dk.brics.automaton:automaton:1.11-8"
}
}
3 changes: 2 additions & 1 deletion spark/sql-13/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
}
}

Expand Down Expand Up @@ -135,4 +136,4 @@ configurations.all { Configuration conf ->
}

conf.exclude group: "org.mortbay.jetty"
}
}
1 change: 1 addition & 0 deletions spark/sql-20/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
}
}

Expand Down
3 changes: 2 additions & 1 deletion storm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jar {
from(zipTree(project(":elasticsearch-hadoop-mr").jar.archivePath)) {
include "org/elasticsearch/hadoop/**"
include "esh-build.properties"
include "META-INF/services/*"
}
}

Expand All @@ -41,4 +42,4 @@ dependencies {
// add itest to Eclipse
//eclipse.classpath.plusConfigurations += [configurations.itestCompile]

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

0 comments on commit 736d484

Please sign in to comment.