forked from gchq/stroom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
399 lines (348 loc) · 16.2 KB
/
build.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
import de.undercouch.gradle.tasks.download.Download
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath group: 'gchq', name: 'urlDependencyPlugin', version: 'v0.1'
classpath group: 'ca.cutterslade.gradle', name: 'gradle-dependency-analyze', version: '1.1.0'
}
}
plugins {
//plugin for downloading content from the 'net
id "de.undercouch.download" version "3.2.0"
//plugin for producing a tree of task dependencies, run task 'taskTree'
id "com.dorongold.task-tree" version "1.3"
}
apply plugin: 'gchq.urldependencies'
//if the project has a value for the passed property (i.e from the cmd line via -PpropName=xxx)
//use that, else use a default value
ext.getPropertyOrDefault = { propName, defaultValue ->
def val;
if (project.hasProperty(propName) && project.getProperty(propName) != "unspecified") {
val = project.getProperty(propName)
println "Using propery $propName with value $val"
} else {
val = defaultValue
println "Propery $propName has no value, using default value $val"
}
return val;
}
ext.gwtCompilerProps = [
mainClass: 'stroom.gwt.GwtCompilerWrapper',
minHeap: getPropertyOrDefault('gwtCompilerMinHeap', '50M'),
maxHeap: getPropertyOrDefault('gwtCompilerMaxHeap', '500M'),
workers: getPropertyOrDefault('gwtCompilerWorkers', '5'),
devModeMinHeap: '50M',
devModeMaxHeap: '1G'
]
//version numbers for libs that share version numbers, e.g. dropwizard-*, or for github repo release versions
ext.versions = [
//----------Stroom-----------------
stroom: getPropertyOrDefault('version', 'SNAPSHOT'),
//------Stroom-repos---------------
stroomProxyRepo: 'v5.1-beta.8',
eventLogging: 'v3.1.0',
hadoopCommonShaded: 'v2.6.4-3',
hadoopHdfsShaded: 'v2.6.4',
stroomExpression: 'v1.0.0',
stroomQuery: 'v2.0.0-alpha.3', //same version for both stroom-query-api and stroom-query-common
stroomStats: 'v0.4.0-alpha',
//------------3rd-party------------
curator: '2.12.0', //must be chosen to be compatible with the ZK version in CDH 5.10
dropwizard: '1.1.0', //if you change this version you should check the versions below that need to move in sync with it
dropwizard_metrics: '3.1.2', //should be kept in step with dropwizard
gwt: '2.8.0',
hibernate: '4.3.8.Final', //dropwiz 1.1.0 uses -validator 5.3.4.Final and -core 5.2.8.Final
jackson: '2.8.6',
jersey: '2.25.1',
jetty: '9.4.2.v20170220', //in line with dropwizard 1.1.0
logback: '1.2.1', //in line with dropwizard 1.1.0
lucene: '5.5.3',
shiro: '1.3.2',
slf4j: '1.7.24', //in line with dropwizard 1.1.0
spring: '4.3.4.RELEASE',
swagger: '1.5.16',
zzDUMMYzz: 'makes sorting easier'
]
//lib names for urlDependenciesPlugin
ext.urlLibs = [
stroomQueryApi: "stroom-query-api-$versions.stroomQuery",
stroomQueryApiSources: "stroom-query-api-$versions.stroomQuery-sources",
stroomQueryCommon: "stroom-query-common-$versions.stroomQuery",
stroomQueryCommonSources: "stroom-query-common-$versions.stroomQuery-sources",
stroomExpression: "stroom-expression-$versions.stroomExpression",
stroomStatsApi: "stroom-stats-api-$versions.stroomStats",
stroomProxyRepo: "stroom-proxy-repo-$versions.stroomProxyRepo",
eventLogging: "event-logging-$versions.eventLogging",
hadoopCommonShaded: "hadoop-common-shaded-$versions.hadoopCommonShaded-all",
hadoopHdfsShaded: "hadoop-hdfs-shaded-$versions.hadoopHdfsShaded-all",
zzDUMMYzz: "makes sorting easier"
]
//dependency strings for use in sub projects
ext.libs = [
aopalliance: "aopalliance:aopalliance:1.0",
aspectjrt: "org.aspectj:aspectjrt:1.8.10",
aspectjweaver: "org.aspectj:aspectjweaver:1.8.10",
assertj_core: "org.assertj:assertj-core:3.6.2",
c3p0: "com.mchange:c3p0:0.9.5.2",
commons_compress: "org.apache.commons:commons-compress:1.12",
commons_fileupload: "commons-fileupload:commons-fileupload:1.3.2",
commons_io: "commons-io:commons-io:2.5",
commons_lang: "commons-lang:commons-lang:2.6",
commons_pool2: "org.apache.commons:commons-pool2:2.4.2",
curator_client: "org.apache.curator:curator-client:$versions.curator",
curator_framework: "org.apache.curator:curator-framework:$versions.curator",
curator_x_discovery: "org.apache.curator:curator-x-discovery:$versions.curator",
dropwizard_assets: "io.dropwizard:dropwizard-assets:$versions.dropwizard" ,
dropwizard_client: "io.dropwizard:dropwizard-client:$versions.dropwizard",
dropwizard_core: "io.dropwizard:dropwizard-core:$versions.dropwizard" ,
dropwizard_jersey: "io.dropwizard:dropwizard-jersey:$versions.dropwizard",
dropwizard_jetty: "io.dropwizard:dropwizard-jetty:$versions.dropwizard", //was 1.0.6 now 1.1.0
dropwizard_metrics_annotation: "io.dropwizard.metrics:metrics-annotation:$versions.dropwizard_metrics",
dropwizard_metrics_healthchecks: "io.dropwizard.metrics:metrics-healthchecks:$versions.dropwizard_metrics",
dropwizard_servlets: "io.dropwizard:dropwizard-servlets:$versions.dropwizard",
dropwizard_testing: "io.dropwizard:dropwizard-testing:$versions.dropwizard",
ehcache_core: "net.sf.ehcache:ehcache-core:2.6.11",
ehcache_spring_annotations: "com.googlecode.ehcache-spring-annotations:ehcache-spring-annotations:1.2.0",
flyway_core: "org.flywaydb:flyway-core:4.0.3",
gin: "com.google.gwt.inject:gin:2.1.2",
guava: "com.google.guava:guava:21.0", //>=v21 removes MoreExecutors.sameThreadExecutor() which is needed by curator 2.11
guice: "com.google.inject:guice:3.0",
gwt_dev: "com.google.gwt:gwt-dev:$versions.gwt",
gwt_servlet: "com.google.gwt:gwt-servlet:$versions.gwt",
gwt_user: "com.google.gwt:gwt-user:$versions.gwt",
gwtp_mvp_client: "com.gwtplatform:gwtp-mvp-client:0.7",
hamcrest_core: "org.hamcrest:hamcrest-core:1.3",
hbase: "org.apache.hbase:hbase-common:1.2.1", //should be set to be consistent with CDH version
hessian: "com.caucho:hessian:4.0.38",
hibernate_core: "org.hibernate:hibernate-core:$versions.hibernate" /* LATEST 5.2.5.Final */,
hibernate_entitymanager: "org.hibernate:hibernate-entitymanager:$versions.hibernate" /* LATEST 5.2.5.Final */,
hibernate_jpa_api: "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final",
hibernate_validator: "org.hibernate:hibernate-validator:5.3.4.Final",
hsqldb: "org.hsqldb:hsqldb:2.3.4",
jBCrypt: "de.svenkubiak:jBCrypt:0.4.1",
jackson_annotations: "com.fasterxml.jackson.core:jackson-annotations:$versions.jackson",
jackson_core: "com.fasterxml.jackson.core:jackson-core:$versions.jackson",
jackson_databind: "com.fasterxml.jackson.core:jackson-databind:$versions.jackson", //was 2.8.5, now 2.8.6
java_jwt: "com.auth0:java-jwt:3.1.0",
javassist: "org.javassist:javassist:3.18.1-GA",
javax_annotation_api: "javax.annotation:javax.annotation-api:1.2",
javax_el: "org.glassfish:javax.el:3.0.1-b08",
javax_el_api: "javax.el:javax.el-api:3.0.0",
javax_inject: "javax.inject:javax.inject:1",
javax_servlet_api: "javax.servlet:javax.servlet-api:3.1.0",
jcl_over_slf4j: "org.slf4j:jcl-over-slf4j:$versions.slf4j",
jersey_client: "org.glassfish.jersey.core:jersey-client:$versions.jersey",
jersey_common: "org.glassfish.jersey.core:jersey-common:$versions.jersey",
jersey_server: "org.glassfish.jersey.core:jersey-server:$versions.jersey", //was 2.25 now 2.25.1
jetty_server: "org.eclipse.jetty:jetty-server:$versions.jetty",
jetty_servlet: "org.eclipse.jetty:jetty-servlet:$versions.jetty",
jetty_servlets: "org.eclipse.jetty:jetty-servlets:$versions.jetty",
jose4j: "org.bitbucket.b_c:jose4j:0.5.5",
jsinterop_annotations: "com.google.jsinterop:jsinterop-annotations:1.0.1",
jul_to_slf4j: "org.slf4j:jul-to-slf4j:$versions.slf4j",
junit: "junit:junit:4.12",
kafka_clients: "org.apache.kafka:kafka-clients:0.10.0.1", //CDH5.10 uses kafka 10.0, Kafka <10.2 is picky about client and server versions.
log4j_over_slf4j: "org.slf4j:log4j-over-slf4j:$versions.slf4j",
logback_classic: "ch.qos.logback:logback-classic:$versions.logback",
logback_core: "ch.qos.logback:logback-core:$versions.logback",
lucene_analyzers_common: "org.apache.lucene:lucene-analyzers-common:$versions.lucene",
lucene_core: "org.apache.lucene:lucene-core:$versions.lucene",
lucene_queryparser: "org.apache.lucene:lucene-queryparser:$versions.lucene",
mockito_core: "org.mockito:mockito-core:2.0.2-beta",
mysql_connector_java: "mysql:mysql-connector-java:5.1.40",
poi: "org.apache.poi:poi:3.15",
poi_ooxml: "org.apache.poi:poi-ooxml:3.15",
saxon_he: "net.sf.saxon:Saxon-HE:9.7.0-18",
shiro_aspectj: "org.apache.shiro:shiro-aspectj:$versions.shiro",
shiro_core: "org.apache.shiro:shiro-core:$versions.shiro",
shiro_spring: "org.apache.shiro:shiro-spring:$versions.shiro",
shiro_web: "org.apache.shiro:shiro-web:$versions.shiro",
slf4j_api: "org.slf4j:slf4j-api:$versions.slf4j",
spring_aop: "org.springframework:spring-aop:$versions.spring",
spring_beans: "org.springframework:spring-beans:$versions.spring",
spring_context: "org.springframework:spring-context:$versions.spring",
spring_context_support: "org.springframework:spring-context-support:$versions.spring",
spring_core: "org.springframework:spring-core:$versions.spring",
spring_jdbc: "org.springframework:spring-jdbc:$versions.spring",
spring_orm: "org.springframework:spring-orm:$versions.spring",
spring_test: "org.springframework:spring-test:$versions.spring",
spring_tx: "org.springframework:spring-tx:$versions.spring",
spring_web: "org.springframework:spring-web:$versions.spring",
spring_web: "org.springframework:spring-web:$versions.spring", //was 4.2.1.RELEASE now 4.3.4.RELEASE
spring_webmvc: "org.springframework:spring-webmvc:$versions.spring",
stax_api: "stax:stax-api:1.0.1",
swagger_annotations: "io.swagger:swagger-annotations:$versions.swagger",
validation_api: "javax.validation:validation-api:1.0.0.GA", //GWT 2.8.0 throws errors on gwtCompile if validation-api 1.1.0.Final is used
vavr: "io.vavr:vavr:0.9.0",
ws_rs_api: "javax.ws.rs:javax.ws.rs-api:2.0.1",
xml_apis: "xml-apis:xml-apis:1.0.b2",
zzDUMMYzz: "makes sorting easier"
]
def contentPackImportDir = "${System.properties['user.home']}/.stroom/contentPackImport/"
def contentReleasesUrl = "http://github.com/gchq/stroom-content/releases/download/"
def visualisationsContentPackVer = "v3.0.4"
def visualisationsContentPackUrl = "http://github.com/gchq/stroom-visualisations-dev/releases/download/${visualisationsContentPackVer}/visualisations-production-${visualisationsContentPackVer}.zip"
//A set of content packs to download in the task downloadStroomContent
ext.contentPacks = [
'core-xml-schemas': 'v1.0',
'internal-statistics-stroom-stats': 'v2.0',
'internal-statistics-sql': 'v2.0',
'internal-dashboards': 'v1.1',
'stroom-101': 'v1.0',
'event-logging-xml-schema': 'v3.1.1'
]
task wrapper(type: Wrapper) {
gradleVersion = '4.1'
}
allprojects {
apply plugin: 'maven'
apply plugin: 'maven-publish'
group = 'stroom'
version = versions.stroom
}
subprojects {
apply plugin: 'java'
//sourceSets {
//logger.info "main.output.classesDirs: " + main.output.classesDirs
//}
//analyze missing dependencies for the code base
apply plugin: 'ca.cutterslade.analyze'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
all {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "log4j", module: "log4j"
exclude module: 'xercesImpl'
resolutionStrategy {
forcedModules = [
//>=v21 removes MoreExecutors.sameThreadExecutor() which is needed by curator 2.11
//libs.guava
]
}
}
}
configurations {
testArtifacts
sourceArtifacts
}
task testJar(type: Jar) {
baseName = "${project.name}-test"
from sourceSets.test.output
}
task sources(type: Jar) {
baseName = "${project.name}-source"
from sourceSets.main.allSource
}
artifacts {
testArtifacts testJar
sourceArtifacts sources
}
task packageTests(type: Jar) {
from sourceSets.test.output
classifier = 'tests'
}
artifacts.archives packageTests
repositories {
mavenLocal()
maven { url "http://repo.maven.apache.org/maven2" }
}
test {
//Use full logging for test exceptions so we can see where the failure occurred
testLogging {
events "failed"
exceptionFormat = 'full'
showStackTraces = true
}
}
//ensure we download our libs before compiling java
tasks.compileJava.dependsOn downloadUrlDependencies
}
task clearContentPackImportDir(type: Delete) {
//ensure the import directory exists
new File(contentPackImportDir).mkdirs()
//cleans out any zip files in the contentPackImportDir
delete fileTree(new File(contentPackImportDir)) {
include '**/*.zip'
}
}
task downloadStroomContent() {
dependsOn clearContentPackImportDir
doLast {
//download each content pack to the contentPackImportDir ready for stroom to import on startup
for (pack in contentPacks) {
def packName = pack.key
def packVer = pack.value
def packUrl = "${contentReleasesUrl}${packName}-${packVer}/${packName}-${packVer}.zip"
download {
src packUrl
dest new File(contentPackImportDir)
overwrite true
}
}
//now get the visualisations pack from a different repo
download {
src visualisationsContentPackUrl
dest new File(contentPackImportDir)
overwrite true
}
}
}
task setupSampleData() {
dependsOn downloadStroomContent
dependsOn ':stroom-integrationtest:setupSampleData'
}
project(':stroom-util') {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
project(':stroom-util-shared') {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
project(':stroom-entity-shared') {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
urlDependencies {
libs "libs"
compile(urlLibs.stroomQueryApi,
"https://github.com/gchq/stroom-query/releases/download/$versions.stroomQuery/${urlLibs.stroomQueryApi}.jar")
compile(urlLibs.stroomQueryApiSources,
"https://github.com/gchq/stroom-query/releases/download/$versions.stroomQuery/${urlLibs.stroomQueryApiSources}.jar")
compile(urlLibs.stroomQueryCommon,
"https://github.com/gchq/stroom-query/releases/download/$versions.stroomQuery/${urlLibs.stroomQueryCommon}.jar")
compile(urlLibs.stroomQueryCommonSources,
"https://github.com/gchq/stroom-query/releases/download/$versions.stroomQuery/${urlLibs.stroomQueryCommonSources}.jar")
compile(urlLibs.stroomExpression,
"https://github.com/gchq/stroom-expression/releases/download/$versions.stroomExpression/${urlLibs.stroomExpression}.jar")
compile(urlLibs.stroomStatsApi,
"https://github.com/gchq/stroom-stats/releases/download/$versions.stroomStats/${urlLibs.stroomStatsApi}.jar")
compile(urlLibs.stroomProxyRepo,
"https://github.com/gchq/stroom-proxy/releases/download/$versions.stroomProxyRepo/${urlLibs.stroomProxyRepo}.jar")
compile(urlLibs.eventLogging,
"https://github.com/gchq/event-logging/releases/download/$versions.eventLogging/${urlLibs.eventLogging}.jar")
compile(urlLibs.hadoopHdfsShaded,
"https://github.com/gchq/hadoop-hdfs-shaded/releases/download/$versions.hadoopHdfsShaded/${urlLibs.hadoopHdfsShaded}.jar")
compile(urlLibs.hadoopCommonShaded,
"https://github.com/gchq/hadoop-common-shaded/releases/download/$versions.hadoopCommonShaded/${urlLibs.hadoopCommonShaded}.jar")
}