-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
395 lines (335 loc) · 15.3 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
plugins {
id 'maven-publish'
id 'signing'
id 'application'
id 'java'
id 'eclipse'
id 'idea'
id 'checkstyle'
id 'jacoco'
id 'com.github.spotbugs' version '5.0.14'
id 'org.jetbrains.kotlin.jvm' version '1.8.20'
id 'org.jetbrains.kotlin.plugin.spring' version '1.8.20'
id 'org.jetbrains.dokka' version '1.8.10'
}
description = "Java Framework for building scalable RESTful web applications"
group = "com.geekbeast"
ext.projectName = "rhizome"
ext.scmUrl = 'scm:git:https://github.com/geekbeast/rhizome.git'
ext.connectionUrl = 'scm:git:https://github.com/geekbeast/rhizome.git'
ext.developerConnectionUrl = 'scm:git:https://github.com/geekbeast/rhizome.git'
if(!project.hasProperty('developmentMode')) {
ext.developmentMode = false
}
println projectName + " with developmentMode = " + project.developmentMode
if( project.hasProperty('developmentMode') && project.developmentMode ) {
if( project.hasProperty('legacy') && project.legacy ) {
println "Using legacy gradles"
apply from: "../gradles/openlattice.gradle"
} else {
apply from: "../gradles/methodic.gradle"
}
} else {
apply from: "https://raw.githubusercontent.com/methodic-labs/methodic/main/gradles/methodic.gradle"
}
mainClassName = "com.geekbeast.rhizome.core.RhizomeAws"
/**
* The reason we use source and target compatability instead of toolchain is that toolchain forces use of the --release
* flag. This flag prevents exports of some commonly used internal java apis in order to enforce compliance with public
* api surface of that particular release. The source and target compatibility settings without the --release flag
* instruct the compiler to generate compatible byte code with that version at the risk of allowing the use of
* potentially unsupported APIs on earlier versions. (i.e compiler 17, target/source 11, will create bytecode that
* references an 17 API that isn't available on jdk 11).
*/
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
checkstyle {
toolVersion = '7.4'
showViolations = false
if( project.hasProperty('developmentMode') && project.developmentMode ) {
config project.resources.text.fromFile("../gradles/checkstyle.xml")
} else {
config project.resources.text.fromUri('https://raw.githubusercontent.com/methodic-labs/methodic/main/gradles/checkstyle.xml')
}
}
tasks.withType(Checkstyle) {
reports {
xml.required = false
html.required = true
}
}
spotbugs {
reportLevel = 'high'
toolVersion = "${spotbugs_annotations_version}"
}
spotbugsMain {
reports {
xml.required = false
html.required = true
}
ignoreFailures = true
}
spotbugsTest {
reports {
xml.required = false
html.required = true
}
ignoreFailures = true
}
run {
if (System.getProperty("exec.args") != null) {
args System.getProperty("exec.args").split()
}
}
tasks.withType(Javadoc) {
enabled = false
}
dokkaHtml {
outputDirectory = new File(buildDir,"javadoc")
//"$buildDir/javadoc")
}
jacoco {
toolVersion = "${project.jacoco_tool_version}"
}
test {
ignoreFailures = true
}
dependencies {
spotbugsPlugins "com.h3xstream.findsecbugs:findsecbugs-plugin:${findsecbugs_version}"
compileOnly "net.jcip:jcip-annotations:${jcip_version}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs_annotations_version}"
testCompileOnly "net.jcip:jcip-annotations:${jcip_version}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs_annotations_version}"
/*
* AWS
*/
api platform('software.amazon.awssdk:bom:2.20.56')
api 'software.amazon.awssdk:s3'
api 'software.amazon.awssdk:ec2'
// api "com.amazonaws:aws-java-sdk-ec2:${aws_java_sdk_version}"
// api "com.amazonaws:aws-java-sdk-s3:${aws_java_sdk_version}"
/*
* Immutables library for immutable objects
*/
annotationProcessor "org.immutables:value:${immutables_version}"
/*
* Servlet API 4.0.1
* 100% Java Servlet Container and Servlet Configuration
*/
implementation "javax.servlet.jsp:javax.servlet.jsp-api:${javax_jsp_api_version}"
api "javax.servlet:javax.servlet-api:${javax_servlet_api_version}"
implementation "javax.servlet:jstl:${jstl_version}"
/*
* SL4J + LOG4J2
*/
api group: "org.slf4j", name: "slf4j-api", version: "${slf4j_version}"
api group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: "${log4j_version}"
api group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4j_version}"
api group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4j_version}"
api group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4j_version}"
/*
* CORE SPRING FRAMEWORK DEPENDENCIES
* Depending injection, asynchronous execution, task scheduling, aspect oriented proxies, and more.
*/
api "org.springframework:spring-core:${project.spring_framework_version}"
api "org.springframework:spring-beans:${project.spring_framework_version}"
api "org.springframework:spring-context:${project.spring_framework_version}"
api "org.springframework:spring-aop:${project.spring_framework_version}"
api "org.springframework:spring-web:${project.spring_framework_version}"
api "org.springframework:spring-webmvc:${project.spring_framework_version}"
api "org.springframework:spring-test:${project.spring_framework_version}"
/*
* SPRING SECURITY DEPENDENCIES
* Solid and battle tested security AuthN/AuthZ framwork
*/
api "org.springframework.security:spring-security-core:${project.spring_security_version}"
api "org.springframework.security:spring-security-web:${project.spring_security_version}"
api "org.springframework.security:spring-security-ldap:${project.spring_security_version}"
api "org.springframework.security:spring-security-config:${project.spring_security_version}"
api "org.springframework.security:spring-security-messaging:${project.spring_security_version}"
//JDBI
api "org.jdbi:jdbi3-core:${jdbi3_version}"
api "org.jdbi:jdbi3-sqlobject:${jdbi3_version}"
api "org.jdbi:jdbi3-postgres:${jdbi3_version}"
api("com.auth0:auth0-spring-security-api:${project.auth0_spring_version}") {
exclude group: "org.springframework.boot"
}
/*
* Metrics
* Awesome reporting-- defaults to Graphite
*/
api "io.dropwizard.metrics:metrics-core:${dropwizard_metrics_version}"
api "io.dropwizard.metrics:metrics-servlets:${dropwizard_metrics_version}"
api "io.dropwizard.metrics:metrics-graphite:${dropwizard_metrics_version}"
api "com.ryantenney.metrics:metrics-spring:${ryantenney_metrics_version}"
/*
* Prometheus - https://prometheus.io/docs
*/
api "io.prometheus:simpleclient:${prometheus_jvm_client_version}"
api "io.prometheus:simpleclient_dropwizard:${prometheus_jvm_client_version}"
api "io.prometheus:simpleclient_servlet:${prometheus_jvm_client_version}"
/*
* GUAVA
* EventBus, FluentIterables, ListenableFutures and more
*/
api "com.google.guava:guava:${guava_version}"
/*
JODA TIME - A better datetime class.
*/
api "joda-time:joda-time:${jodatime_version}"
/*
* APACHE COMMONS
* Logging, StringUtils, RandomStringUtils, IOUtils, and more
*/
api "org.apache.commons:commons-collections4:${commons_collections4_version}"
api "commons-io:commons-io:${commonsio_version}"
api "commons-validator:commons-validator:${commonsvalidator_version}"
api "org.apache.commons:commons-lang3:${commonsLang_version}"
api "commons-codec:commons-codec:${commons_codec_version}"
testApi "org.apache.commons:commons-text:${commonsText_version}"
api "com.esotericsoftware:kryo-shaded:${kryo_shaded_version}"
api "com.esotericsoftware:minlog:${minlog_version}"
api "com.esotericsoftware:reflectasm:${reflectasm_version}"
api "org.objenesis:objenesis:${objenesis_version}"
/*
* JACKSON SERIALIZATION
* YAML via SnakeYaml
* Blackbird for faster serialization
* Guava integration
* Smile for binary serialization
* Jersey integration
* Jaxb annotation support
*/
implementation "com.fasterxml.jackson.core:jackson-core:${jackson_version}"
implementation "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-guava:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-blackbird:${jackson_version}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jackson_version}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jackson_version}"
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson_version}"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson_version}"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${jackson_version}"
implementation "org.yaml:snakeyaml:${snakeyaml_version}"
/*
* @Inject and @Nullable support
*/
implementation "javax.inject:javax.inject:${javax_inject_version}"
/*
* Hibernate Validator
*/
implementation "org.hibernate:hibernate-validator:${hibernate_version}"
implementation "javax.el:javax.el-api:${el_api_version}"
implementation "org.glassfish:javax.el:${el_api_version}"
/*
* HAZELCAST - DISTRIBUTED DATA GRID
* Transparent http clustering, distributed java.util collections
*/
api "com.hazelcast:hazelcast:${hazelcast_version}"
api "com.hazelcast:hazelcast-wm:${hazelcast_wm_version}"
api "com.hazelcast:hazelcast-spring:${hazelcast_version}"
api 'javax.cache:cache-api:1.1.1'
/*
* EMBEDDED JETTY FOR LOCAL TESTING
* TODO: Add support for Tomcat
* TODO: Integrate with application plugin for standalone deployment
*/
implementation "org.ow2.asm:asm:${asm_version}"
api "org.eclipse.jetty:jetty-server:${jetty_version}"
// api "org.eclipse.jetty.aggregate:jetty-all:${jetty_version}"
//TODO: Once GA version of jetty-jsp is released update version.
implementation "org.eclipse.jetty:jetty-spring:10.0.0.beta3"
// implementation "org.eclipse.jetty.websocket:websocket-server:${jetty_version}"
// implementation "org.eclipse.jetty.websocket:javax-websocket-server-impl:${jetty_version}"
implementation "org.eclipse.jetty.websocket:websocket-jetty-server:${jetty_version}"
// implementation "org.eclipse.jetty:jetty-continuation:${jetty_version}"
implementation "org.eclipse.jetty:jetty-alpn-java-server:${jetty_version}"
implementation "org.eclipse.jetty.http2:http2-server:${jetty_version}"
implementation "io.netty:netty-transport-native-epoll:${netty_epoll_version}:${netty_os_arch}"
/*
* JAVAMAIL
* Java email client.
*/
api "org.jodd:jodd-mail:${jodd_mail_version}"
implementation "javax.mail:javax.mail-api:${javax_mail_api}"
implementation "com.sun.mail:javax.mail:${sun_javax_mail_version}"
implementation "com.sun.mail:all:${sun_mail_all_version}"
api "com.samskivert:jmustache:1.15"
/*
* GreenMail
* http://www.icegreen.com/greenmail/
* https://github.com/greenmail-mail-test/greenmail
*
* A library that provides a simple POP3/IMAP/SMTP mail server, and makes writing unit/integration tests easy for
* testing sending/receiving emails against a running mail server.
*/
testImplementation "com.icegreen:greenmail:${greenmail_version}"
/*
* Cassandra
*/
implementation "org.xerial.snappy:snappy-java:${snappy_version}"
implementation "net.jpountz.lz4:lz4:${lz4_version}"
/*
* Postgres
*/
api "com.zaxxer:HikariCP:${hikariCP_version}"
api "org.postgresql:postgresql:${postgresql_version}"
api "com.google.code.findbugs:jsr305:${findbugs_jsr305_version}"
api "javax.annotation:javax.annotation-api:${javax_annotation_api_version}"
api "javax.validation:validation-api:${javax_validation_api_version}"
implementation fileTree(dir: "lib/", include: "*.jar")
api "com.squareup.retrofit2:retrofit:${retrofit2_version}"
/*
* WEBSOCKET DEPENDENCIES
*/
api "org.springframework:spring-websocket:${project.spring_framework_version}"
api "org.springframework:spring-messaging:${project.spring_framework_version}"
api "org.springframework.integration:spring-integration-websocket:${project.spring_websocket_version}"
/*
* TESTING
*/
testImplementation "junit:junit:${junit_version}"
testImplementation "org.mockito:mockito-all:${mockito_version}"
if( (project.hasProperty('subModule') && project.subModule) || (project.hasProperty('developmentMode') && project.developmentMode) ) {
testImplementation(project(path: ":rhizome-client", configuration: "tests"))
api(project(path: ":rhizome-client"))
} else {
testImplementation "com.openlattice:rhizome-client:${rhizome_client_version}:tests"
api "com.openlattice:rhizome-client:${rhizome_client_version}"
}
api "com.auth0:mvc-auth-commons:${auth0_mvc_auth_commons_version}"
api "com.auth0:java-jwt:${auth0_java_jwt_version}"
api "com.auth0:jwks-rsa:${auth0_jwks_rsa_version}"
api "com.auth0:auth0:${project.auth0_version}"
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}
tasks.withType(JavaCompile) {
options.compilerArgs+= ["--add-modules", "java.base",
"--add-modules", "java.se",
"--add-exports","java.base/jdk.internal.ref=ALL-UNNAMED"]
}
tasks.withType(Test) {
jvmArgs += ["--add-modules", "java.base",
"--add-modules", "java.se",
"--add-exports","java.base/jdk.internal.ref=ALL-UNNAMED",
"--add-opens","java.base/java.lang=ALL-UNNAMED",
"--add-opens","java.base/java.nio=ALL-UNNAMED",
"--add-opens","java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens","java.management/sun.management=ALL-UNNAMED",
"--add-opens", "jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED",
"--add-opens","jdk.management/com.sun.management.internal=ALL-UNNAMED"]
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs += '-Xjvm-default=compatibility'
}
}
eclipse {
ext.downloadSources = true
ext.downloadJavadoc = true
ext.sourceCompatibility = JavaVersion.VERSION_17
ext.targetCompatibility = JavaVersion.VERSION_17
}