-
Notifications
You must be signed in to change notification settings - Fork 993
Use subproject to generate distribution instead of root #1463
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ef04f10
WIP Created a dist project and using it to construct the zip/uberjar
jbaiera 5bbac0b
Add javadocSources and javadocElements configurations.
jbaiera fadc04c
Export missing package.java files from the scala source for javadocs.
jbaiera 34e3bc4
DRY the dist project's dependencies.
jbaiera a94191f
Fixing up
jbaiera ac44403
Merge branch 'master' into add-dist-subproject
jbaiera 379ea5e
Merge branch 'master' into add-dist-subproject
jbaiera bb84e43
Update dist project with correct dependency names
jbaiera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
|
||
apply plugin: 'es.hadoop.build' | ||
|
||
description = "Elasticsearch for Apache Hadoop" | ||
project.archivesBaseName = 'elasticsearch-hadoop' | ||
|
||
configurations { | ||
embedded { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
transitive = false | ||
} | ||
dist { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
attributes { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, 'packaging')) | ||
} | ||
} | ||
} | ||
|
||
def distProjects = [":elasticsearch-hadoop-mr", ":elasticsearch-hadoop-hive", ":elasticsearch-hadoop-pig", | ||
":elasticsearch-spark-20", ":elasticsearch-storm"] | ||
distProjects.each { distProject -> | ||
dependencies { | ||
// This is only going to pull in each project's regular jar to create the project-wide uberjar. | ||
embedded(project(distProject)) | ||
// To squash Javadoc warnings. | ||
compileOnly(project(distProject)) | ||
// This will pull all java sources (including generated) for the project-wide javadoc. | ||
javadocSources(project(distProject)) | ||
// This will pull all non-generated sources for the project-wide source jar. | ||
additionalSources(project(distProject)) | ||
// This will pull in the regular jar, javadoc jar, and source jar to be packaged in the distribution. | ||
dist(project(distProject)) | ||
} | ||
} | ||
|
||
dependencies { | ||
// For Uber pom (and Javadoc to a lesser extent) | ||
implementation("commons-logging:commons-logging:1.1.1") | ||
implementation("commons-httpclient:commons-httpclient:3.0.1") | ||
implementation("commons-codec:commons-codec:1.4") | ||
implementation("javax.xml.bind:jaxb-api:2.3.1") | ||
implementation("org.apache.hive:hive-service:$hiveVersion") { | ||
exclude module: "log4j-slf4j-impl" | ||
} | ||
implementation("org.apache.hive:hive-exec:$hiveVersion") | ||
implementation("org.apache.hive:hive-metastore:$hiveVersion") | ||
implementation("org.apache.pig:pig:$pigVersion:h2") | ||
implementation("org.apache.spark:spark-core_${project.ext.scala211MajorVersion}:$spark20Version") { | ||
exclude group: 'javax.servlet' | ||
exclude group: 'org.apache.hadoop' | ||
} | ||
implementation("org.apache.spark:spark-yarn_${project.ext.scala211MajorVersion}:$spark20Version") { | ||
exclude group: 'org.apache.hadoop' | ||
} | ||
implementation("org.apache.spark:spark-sql_${project.ext.scala211MajorVersion}:$spark20Version") { | ||
exclude group: 'org.apache.hadoop' | ||
} | ||
implementation("org.apache.spark:spark-streaming_${project.ext.scala211MajorVersion}:$spark20Version") { | ||
exclude group: 'org.apache.hadoop' | ||
} | ||
implementation("org.scala-lang:scala-library:$scala211Version") | ||
implementation("org.scala-lang:scala-reflect:$scala211Version") | ||
implementation("org.apache.storm:storm-core:$stormVersion") { | ||
exclude module: "log4j-slf4j-impl" | ||
} | ||
implementation(project.ext.hadoopClient) | ||
implementation("org.apache.hadoop:hadoop-common:${project.ext.hadoopVersion}") | ||
implementation("org.apache.hadoop:hadoop-mapreduce-client-core:${project.ext.hadoopVersion}") | ||
implementation("org.codehaus.jackson:jackson-mapper-asl:${project.ext.jacksonVersion}") | ||
implementation("org.codehaus.jackson:jackson-core-asl:${project.ext.jacksonVersion}") | ||
implementation("joda-time:joda-time:$jodaVersion") | ||
compileOnly("org.apache.spark:spark-catalyst_${project.ext.scala211MajorVersion}:$spark20Version") | ||
} | ||
jbaiera marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Configure uber jar | ||
jar { | ||
dependsOn(project.configurations.embedded) | ||
|
||
manifest { | ||
attributes['Implementation-Title'] = 'elasticsearch-hadoop' | ||
} | ||
|
||
from(project.configurations.embedded.collect { it.isDirectory() ? it : zipTree(it)}) { | ||
include "org/elasticsearch/**" | ||
include "esh-build.properties" | ||
include "META-INF/services/*" | ||
} | ||
|
||
// Each integration will be copying it's entire jar contents into this master jar. | ||
// There will be lots of duplicates since they all package up the core code inside of them. | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} | ||
|
||
javadoc { | ||
options { | ||
header = "elasticsearch-hadoop" | ||
} | ||
} | ||
|
||
// Name of the directory under the root of the zip file that will contain the zip contents | ||
String zipContentDir = "elasticsearch-hadoop-${project.version}" | ||
|
||
// Create a zip task for creating the distribution | ||
task('distZip', type: Zip) { | ||
group = 'Distribution' | ||
description = "Builds zip archive, containing all jars and docs, suitable for download page." | ||
|
||
dependsOn(tasks.pack) | ||
|
||
from(project.rootDir) { | ||
include('README.md') | ||
include('LICENSE.txt') | ||
include('NOTICE.txt') | ||
into(zipContentDir) | ||
} | ||
|
||
into("$zipContentDir/dist") { | ||
from(project.configurations.dist) | ||
from(tasks.jar) | ||
from(tasks.javadocJar) | ||
from(tasks.sourcesJar) | ||
} | ||
} | ||
|
||
distribution { | ||
dependsOn(distZip) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant. Seems we've finally nailed down these configuration attributes to work the way we want.