forked from h2oai/h2o-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassemblyjar.gradle
116 lines (103 loc) · 4.15 KB
/
assemblyjar.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
description = 'H2O HDFS client shadowjar for Hadoop ' + hadoopVersion
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile(project(":h2o-mapreduce-generic")) {
transitive = false
}
compile project(":h2o-security")
compile project(":h2o-ext-steam")
compile "org.apache.hadoop:hadoop-client:$hadoopMavenArtifactVersion"
compile "org.apache.hadoop:hadoop-mapreduce-client-app:$hadoopMavenArtifactVersion"
// Libraries need for Google Cloud Storage strongly require this Guava version
compile('com.google.guava:guava:20.0') {force = true}
compile(project(':h2o-app')) {
exclude module: "${defaultWebserverModule}"
}
compile project(":h2o-web")
compile project(":h2o-avro-parser")
// Include GCS persist layer
compile(project(":h2o-persist-gcs"))
// Include S3 persist layer
compile(project(":h2o-persist-s3"))
// Include HDFS persist layer
compile(project(':h2o-persist-hdfs')) {
transitive = false
}
compile(project(':h2o-hive')) {
transitive = false
}
compile("org.apache.parquet:parquet-avro:${defaultParquetVersion}") // required by h2o-hive
// For standalone mode to work with MapR, this extra library needs to be
// included, and it's not pulled in by the dependency stuff; this must
// be a bug in MapR's packaging process.
if (project.hasProperty("maprExtraDependency")) {
compile(project.property("maprExtraDependency"))
}
if (orcSupported) {
compile(project(":h2o-orc-parser")) {
// We do not get any dependencies but directly rely on provided environment
transitive = false
}
// Here we depends on hive-exec, but it is Hadoop version specific
compile("org.apache.hive:hive-exec:$orcHiveExecVersion") {
transitive = false
}
}
compile(project(":h2o-parquet-parser"))
}
//
// Bundle optional modules
// The process is defined by convention. There are two flags:
// - -Pwith${componentName}=true - enables component "componentName" and includes it in assembly
// - -P${componentName}Version=3.14 - overrides default component version
//
for (comp in optionalComponents) {
def compName = comp['name']
def compVersion = comp['version']
def compEnabled = comp['enabled']
def compPropName = "with${compName.capitalize()}"
def compPropVersionName = "${compName}Version"
if (!project.hasProperty(compPropVersionName)) {
project.ext.set(compPropVersionName, compVersion)
}
if (compEnabled || project.hasProperty(compPropName) && project.property(compPropName)) {
logger.lifecycle("== ${project.path}: Using optional component: ${compName}, version ${project.findProperty(compPropVersionName)}")
apply from: "$rootDir/gradle/components/${compName}.gradle"
}
}
def hadoopShadowJarExcludes = ['META-INF/*.DSA',
'META-INF/*.SF',
'synchronize.properties',
'uploader.properties',
'test.properties',
'cockpitlite.properties',
'devpay_products.properties',
// the license files are excluded for OS X compatibility (this is mainly for development)
// OS X is unable to unpack these files from the jar on filesystem that is not case sensitive
'LICENSE', 'license', 'LICENSE/*', 'license/*', 'META-INF/license', 'META-INF/LICENSE'
]
shadowJar {
mergeServiceFiles()
// Keep JODATIME shadowed even for CDH 6+
relocate 'org.joda.time', 'ai.h2o.org.joda.time'
exclude hadoopShadowJarExcludes
relocate 'com.google.common', 'ai.h2o.com.google.common'
relocate 'org.eclipse.jetty', 'ai.h2o.org.eclipse.jetty'
baseName = 'h2odriver'
classifier = ''
manifest {
attributes 'Main-Class': 'water.hadoop.h2odriver'
}
zip64 true
}
artifacts {
archives shadowJar
}
// We just need Shadow Jar
jar {
enabled = false
}
build.dependsOn shadowJar