-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle
184 lines (161 loc) · 8.19 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
plugins {
id 'com.netflix.nebula.ospackage' version "11.6.0"
id 'checkstyle'
id "io.freefair.lombok" version "8.4"
id 'jacoco'
id 'java'
id 'java-library'
id "com.diffplug.spotless" version "6.23.3"
id 'idea'
id 'eclipse'
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
allprojects {
version = '3.0.0-SNAPSHOT'
// Force using a newer version, due to guava vulnerability CVE-2023-2976. Remove after Gradle upgrades its default version.
checkstyle {
toolVersion = "10.12.3"
}
java {
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'com.diffplug.spotless'
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
sdk_version = "3.24.0"
jackson_version = "2.17.2"
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
// Fix dependency collision with opensearch
configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-annotations:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-core:${jackson_version}"
force "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson_version}"
force "commons-codec:commons-codec:1.15"
force "org.apache.httpcomponents:httpcore:4.4.15"
force "jakarta.annotation:jakarta.annotation-api:2.1.1"
force "org.javassist:javassist:3.25.0-GA"
force "org.apache.httpcomponents:httpclient:4.5.14"
// Force spotless depending on newer version of guava due to CVE-2023-2976. Remove after spotless upgrades.
force "com.google.guava:guava:32.1.2-jre"
// Force opensearch transport-netty4-client depending on newer version of netty-handler due to CVE-2023-34462.
// Remove after upgrading the compiled opensearch version.
force "io.netty:netty-handler:4.1.94.Final"
force "org.bouncycastle:bcpkix-jdk15to18:1.78.1"
force "org.bouncycastle:bcprov-jdk15to18:1.78.1"
force "org.bouncycastle:bcutil-jdk15to18:1.78.1"
}
}
dependencies {
implementation "net.jodah:failsafe:2.4.0"
implementation "com.google.guava:guava:32.1.2-jre"
implementation "org.apache.commons:commons-lang3:3.9"
implementation "commons-io:commons-io:2.7"
implementation "commons-logging:commons-logging:1.2"
implementation "commons-codec:commons-codec:1.15"
/******************** Hacking transient dependencies for OCI SDK ********************/
// TODO: For some odd reason it seems that the OpenSearch gradle plugin overrides resolution of implementation
// configuration which is why this hack is needed so we can get the transient dependencies packaged properly
implementation("com.oracle.oci.sdk:oci-java-sdk-common-httpclient:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-common:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-objectstorage-generated:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-objectstorage-extensions:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-circuitbreaker:${sdk_version}")
implementation("io.github.resilience4j:resilience4j-circuitbreaker:1.7.1")
implementation("io.github.resilience4j:resilience4j-core:1.7.1")
implementation("jakarta.ws.rs:jakarta.ws.rs-api:2.1.6")
implementation("org.glassfish.jersey.media:jersey-media-json-jackson:2.35")
implementation("org.glassfish.jersey.ext:jersey-entity-filtering:2.35")
implementation("org.glassfish.jersey.core:jersey-client:2.35")
implementation("org.glassfish.jersey.core:jersey-common:2.35")
implementation("org.glassfish.jersey.inject:jersey-hk2:2.35")
implementation("org.glassfish.jersey.connectors:jersey-apache-connector:2.35")
implementation("jakarta.annotation:jakarta.annotation-api:2.1.1")
implementation("org.glassfish.hk2.external:jakarta.inject:2.6.1")
implementation("org.glassfish.hk2.external:aopalliance-repackaged:2.6.1")
implementation("org.glassfish.hk2:hk2-locator:2.6.1")
implementation("org.glassfish.hk2:hk2-utils:2.6.1")
implementation("org.glassfish.hk2:osgi-resource-locator:1.0.3")
implementation("org.glassfish.hk2:hk2-api:2.6.1")
implementation("org.apache.httpcomponents:httpclient:4.5.14")
implementation("org.apache.httpcomponents:httpcore:4.4.15")
implementation("org.bouncycastle:bcpkix-jdk15to18:1.78.1")
implementation("org.bouncycastle:bcprov-jdk15to18:1.78.1")
implementation("org.bouncycastle:bcutil-jdk15to18:1.78.1")
implementation("org.javassist:javassist:3.25.0-GA")
implementation("io.vavr:vavr:0.10.2")
implementation("io.vavr:vavr-match:0.10.2")
implementation("jakarta.xml.bind:jakarta.xml.bind-api:2.3.3")
implementation("jakarta.activation:jakarta.activation-api:1.2.2")
implementation("org.slf4j:slf4j-api") {
version {
strictly "1.7.33"
}
}
/******************************* End of transient dependency hack for OCI SDK*****************************************/
implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jackson_version}")
implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${jackson_version}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson_version}")
implementation("com.fasterxml.jackson.core:jackson-annotations:${jackson_version}")
implementation("com.fasterxml.jackson.core:jackson-databind:${jackson_version}")
implementation("com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jackson_version}")
compileOnly "org.opensearch:opensearch:${opensearch_version}"
// Test dependencies
testImplementation 'org.assertj:assertj-core:3.18.1'
}
compileJava {
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
doFirst {
// TODO: do not fail build on warnings, need to fix all compiler warnings
options.compilerArgs.remove('-Werror')
// TODO: need to fix all java doc format
options.compilerArgs.remove('-Xdoclint:all')
}
}
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
//ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
//indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// only scan main source files
target 'src/main/**/*.java'
// Use the default importOrder configuration
importOrder()
removeUnusedImports()
// apply a specific flavor of google-java-format
googleJavaFormat().aosp().reflowLongStrings()
// fix formatting of type annotations
formatAnnotations()
}
}
}