-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.gradle
400 lines (331 loc) · 14 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
398
399
400
import com.github.jk1.license.render.*
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.researchgate.release'
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'project-report'
apply plugin: "org.sonarqube"
apply from: "$rootDir/gradle/ext/coding-format.gradle"
apply plugin: 'com.github.jk1.dependency-license-report'
// To embed into the release process. './gradlew' install will be called.
apply plugin: 'maven'
dependencyManagement {
dependencies {
imports {
mavenBom 'software.amazon.awssdk:bom:2.17.95'
}
}
}
// Configure the maven repository deployment
install {
repositories.mavenInstaller {
// Set the version
pom.version = connectorIaaSVersion
// Set the group/namespace for the maven repository deployment.
pom.groupId = 'org.ow2.proactive'
}
}
repositories {
if (project.hasProperty('local')) mavenLocal()
// Needed by Microsoft Azure Java SDK
maven {
url "http://repository.springsource.com/maven/bundles/release"
}
maven {
url "http://repository.springsource.com/maven/bundles/external"
}
mavenCentral()
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "http://repository.activeeon.com/content/groups/proactive/"
}
mavenCentral()
}
def springBootVersion = "1.5.22.RELEASE"
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.ajoberstar:gradle-jacoco:0.3.0'
classpath 'net.researchgate:gradle-release:2.2.1'
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1"
classpath "com.diffplug.gradle.spotless:spotless:2.4.0"
classpath "org.ow2.proactive:coding-rules:1.0.0"
classpath 'com.github.jk1:gradle-license-report:1.7'
}
dependencies {
delete "gradle/ext"
ant.unjar src: configurations.classpath.find { it.name.startsWith("coding-rules") }, dest: 'gradle/ext'
}
}
mainClassName = 'org.ow2.proactive.connector.iaas.ConnectorIaaSApp'
springBoot {
mainClass = mainClassName
}
bootRepackage {
enabled = false
}
// version is not set to make the war filename short and nice
war {
baseName = 'connector-iaas'
}
jar {
baseName = 'connector-iaas'
// Version is define in gradle.properties
version = connectorIaaSVersion
manifest {
attributes 'Main-Class': mainClassName
attributes 'Class-Path': "."
}
}
shadowJar {
zip64 = true
mergeServiceFiles()
}
def jdkHome = System.getenv("JAVA_HOME")
release {
preTagCommitMessage = '[ci skip][Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = '[ci skip][Gradle Release Plugin] - creating tag: '
newVersionCommitMessage = '[ci skip][Gradle Release Plugin] - new version commit: '
}
configurations {
// Those modules are excluded to avoid clashes when embedded inside the ProActive Scheduler
all*.exclude module: 'spring-boot-starter-logging'
all*.exclude module: 'logback-core'
all*.exclude module: 'logback-classic'
all*.exclude group: 'org.bouncycastle', module: 'bcprov-ext-jdk15on'
all*.exclude group: 'org.bouncycastle', module: 'bcpkix-jdk15on'
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
dependencies {
// Jackson dependencies
def jacksonVersion = "2.16.1"
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
compile "com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:${jacksonVersion}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${jacksonVersion}"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jacksonVersion}"
compile "jakarta.activation:jakarta.activation-api:2.1.2"
// route all log4j 2 and jul to slf4j
compile 'org.slf4j:log4j-over-slf4j:1.7.36'
compile 'org.slf4j:jul-to-slf4j:1.7.36'
compile 'org.slf4j:jcl-over-slf4j:1.7.36'
compile 'org.slf4j:slf4j-api:1.7.36'
// Lombok plugin to remove boilerplate code from project
compile 'org.projectlombok:lombok:1.16.14'
// Guava allows immutable classes/objects
compile 'com.google.guava:guava:32.0.1-jre'
// Support for easy class to Json convertion and vice verca
compile 'com.oath.microservices:micro-jackson-configuration:1.2.6'
compile 'javax.validation:validation-api:1.1.0.Final'
def springBootVersion = "1.5.22.RELEASE"
compile 'org.yaml:snakeyaml:2.0'
// For using the rest jersey annotations
compile("org.springframework.boot:spring-boot-starter-jersey:${springBootVersion}") {
exclude module: "spring-boot-starter-tomcat"
}
// The basic spring boot web 'packet' -- tomcat is excluded because this project will be embedded
// in ProActive Scheduler
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude module: "spring-boot-starter-tomcat"
}
// This allows log4j logging for spring boot. This dependency is needed for standalaone but will
// clash with the ProActive Scheduler dependencies when included. It is excluded in configurations above.
compile("org.springframework.boot:spring-boot-starter-log4j2:${springBootVersion}") {
exclude group: "org.apache.logging.log4j"
}
// Provides a standalone jetty server. It is providedCompile to be placed inside the provided folder
// in the war/jar. When a war is loaded, the jars in the provided folder are not loaded.
providedCompile("org.springframework.boot:spring-boot-starter-jetty:${springBootVersion}")
def jettyVersion = "9.4.53.v20231009"
providedCompile("org.eclipse.jetty:jetty-servlets:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-servlet:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-continuation:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-annotations:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-http:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-client:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-plus:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-security:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-util:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-io:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-xml:${jettyVersion}")
providedCompile("org.eclipse.jetty:jetty-webapp:${jettyVersion}")
providedCompile("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}")
providedCompile("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
providedCompile("org.eclipse.jetty.websocket:javax-websocket-server-impl:${jettyVersion}")
// The spring version was upgraded to 4.3.30.RELEASE after recent changes
def springVersion = "4.3.30.RELEASE"
compile("org.springframework:spring-core:${springVersion}")
compile("org.springframework:spring-aop:${springVersion}")
compile("org.springframework:spring-beans:${springVersion}")
compile("org.springframework:spring-context:${springVersion}")
compile("org.springframework:spring-context-support:${springVersion}")
compile("org.springframework:spring-expression:${springVersion}")
compile("org.springframework:spring-web:${springVersion}")
compile("org.springframework:spring-webmvc:${springVersion}")
def jcloudsVersion = "2.5.0"
// Jcloud
compile ("org.apache.jclouds:jclouds-allcompute:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
compile ("org.apache.jclouds:jclouds-compute:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
compile ("org.apache.jclouds.api:openstack-nova:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
compile ("org.apache.jclouds.api:openstack-keystone:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
compile ("org.apache.jclouds.provider:aws-ec2:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
compile ("org.apache.jclouds.provider:google-compute-engine:${jcloudsVersion}"){
exclude module : 'jsr311-api'
}
// Prevent the usage of an old version of SSHJ
compile "org.apache.jclouds.driver:jclouds-sshj:${jcloudsVersion}"
// Prevent the usage of an old version of bouncycastle dependencies
compile 'org.bouncycastle:bcprov-ext-jdk18on:1.77'
compile 'org.bouncycastle:bcpkix-jdk18on:1.77'
compile 'io.netty:netty-codec-http:4.1.101.Final'
compile 'io.netty:netty-codec-http2:4.1.101.Final'
compile 'io.netty:netty-transport-native-epoll:4.1.101.Final'
compile 'com.typesafe.netty:netty-reactive-streams-http:2.0.9'
// libraries used by multiple providers that must be upgraded
compile 'commons-codec:commons-codec:1.13'
compile 'org.apache.httpcomponents:httpclient:4.5.14'
// VMware dependency
// include dom4j directly to not display the version
// (the version cannot be upgraded)
compile files('lib/org.dom4j.dom4j-custom.jar')
compile files('lib/dom4j-custom.jar')
compile 'ch.qos.reload4j:reload4j:1.2.25'
compile ('com.toastcoders:yavijava:6.0.05') {
exclude group: 'org.apache.directory.studio', module: 'org.dom4j.dom4j'
exclude group: 'log4j', module: 'log4j'
}
// Microsoft Azure
compile 'net.minidev:json-smart:2.4.9'
compile 'com.github.stephenc.jcip:jcip-annotations:1.0-1'
compile files('lib/nimbus-jose-jwt-9.8.1.jar')
compile ('com.microsoft.azure:azure:1.41.3') {
exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt'
exclude group: 'com.nimbusds', module: 'nimbus-jose-jwt'
}
compile 'com.microsoft.azure:azure-mgmt-network:1.41.3'
// AWS Pricing
compile group: 'software.amazon.awssdk', name: 'pricing', version: '2.17.95'
// Fixing AWS node candidates retrieving
// For more info: https://github.com/aws/aws-sdk-java-v2/issues/652#issuecomment-476247813
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.9'
// Json project
compile 'org.json:json:20231013'
// Gson dependency
compile 'com.google.code.gson:gson:2.8.9'
//Logger
compile 'org.apache.logging.log4j:log4j-api:2.17.1'
compile 'org.apache.logging.log4j:log4j-core:2.17.1'
compile 'org.apache.logging.log4j:log4j-web:2.17.1'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.1'
testCompile ('org.apache.logging.log4j:log4j-api:2.4.1') {
force = true
}
testCompile ('org.apache.logging.log4j:log4j-core:2.4.1') {
force = true
}
testCompile ('org.apache.logging.log4j:log4j-web:2.4.1') {
force = true
}
testCompile ('org.apache.logging.log4j:log4j-slf4j-impl:2.4.1') {
force = true
}
// Imports for JUnit tests
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.28'
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testCompile 'com.jayway.restassured:rest-assured:2.8.0'
compile files("$jdkHome/lib/tools.jar")
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version:'1.1'
testCompile ('junit:junit:4.12') {
exclude module : 'hamcrest'
exclude module : 'hamcrest-core'
}
testCompile 'org.mockito:mockito-core:2.7.17'
testCompile "org.springframework:spring-test:${springVersion}"
}
sourceSets {
test {
java.srcDir file('src/test/java')
resources.srcDir file('src/test/resources')
}
integTest {
java.srcDir file('src/integTest/java')
resources.srcDir file('src/integTest/resources')
}
}
task integTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
}
dependencies {
integTestCompile sourceSets.main.output
integTestCompile configurations.testCompile
integTestCompile sourceSets.test.output
integTestRuntime configurations.testRuntime
}
task local {
run { systemProperty "spring.profiles.active", "local" }
}
allprojects {
apply plugin: "org.sonarqube"
apply plugin: 'jacoco'
apply plugin: 'project-report'
sonarqube {
properties {
property "sonar.projectKey", "$project.group:connector-iaas"
property "sonar.projectName", "connector-iaas"
property "sonar.jdbc.driverClassName", "org.postgresql.Driver"
property "sonar.language", "java"
property "sonar.skipDesign" , "true"
property "sonar.sources", "src/main/java"
property 'sonar.jacoco.reportPath', "${buildDir}/jacoco/testDebug.exec"
property 'sonar.junit.reportsPath', "${buildDir}/test-results"
property "sonar.java.binaries", "**/classes"
property "sonar.java.libraries", "**/*.jar"
}
}
jacoco {
toolVersion = '0.7.1.201405082137'
}
jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
}
licenseReport {
configurations = ['runtime']
renderers = [new InventoryHtmlReportRenderer()]
}