-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
151 lines (126 loc) · 3.81 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
plugins {
id 'java-library'
id 'io.freefair.lombok' version '8.10.2'
id 'jacoco'
id 'org.sonarqube' version '5.1.0.4882'
id 'maven-publish'
}
group = 'com.iexec.common'
ext {
mockServerVersion = '5.11.2'
openFeignVersion = '11.10'
}
if (!project.hasProperty('gitBranch')) {
ext.gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
}
if (gitBranch != 'main' && gitBranch != 'master' && !(gitBranch ==~ '(release|hotfix|support)/.*')) {
version += '-NEXT-SNAPSHOT'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url = 'https://docker-regis-adm.iex.ec/repository/maven-public/'
credentials {
username nexusUser
password nexusPassword
}
}
maven {
url "https://jitpack.io"
}
}
//configurations.configureEach {
// resolutionStrategy.failOnVersionConflict()
//}
// java-library plugin defines 'api' configuration
// 'api' configuration allows to expose dependencies with 'compile' scope in pom
// 'implementation' configuration allows to expose dependencies with 'runtime' scope in pom
dependencies {
implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
// feign
api "io.github.openfeign:feign-jackson:$openFeignVersion"
api "io.github.openfeign:feign-slf4j:$openFeignVersion"
// iexec
implementation "com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion"
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
// commons-io
implementation 'commons-io:commons-io:2.13.0'
// apache commons-lang3
implementation 'org.apache.commons:commons-lang3'
//jaxb required with Java 11
implementation 'javax.xml.bind:jaxb-api'
// zip
implementation 'net.lingala.zip4j:zip4j:2.3.1'
// google core libs
implementation 'com.google.guava:guava:28.2-jre'
implementation 'ch.qos.logback:logback-classic'
implementation 'javax.annotation:javax.annotation-api'
implementation 'javax.validation:validation-api'
implementation 'org.hibernate.validator:hibernate-validator'
implementation 'org.glassfish:javax.el:3.0.0'
// expiring map
implementation 'net.jodah:expiringmap:0.5.10'
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
sourceCompatibility = "11"
targetCompatibility = "11"
withJavadocJar()
withSourcesJar()
}
testing {
suites {
test {
useJUnitJupiter()
dependencies {
implementation 'org.junit.jupiter:junit-jupiter'
implementation 'org.mockito:mockito-junit-jupiter'
implementation 'org.assertj:assertj-core'
// mock-server
implementation "org.mock-server:mockserver-client-java:$mockServerVersion"
implementation "org.mock-server:mockserver-junit-jupiter:$mockServerVersion"
// spring-test for ReflectionTestUtils
implementation 'org.springframework:spring-test'
}
}
}
}
tasks.withType(Test).configureEach {
finalizedBy jacocoTestReport
}
test {
reports {
junitXml.required = true
html.required = true
}
}
tasks.register('itest') {
group 'Verification'
description 'Runs the integration tests.'
}
// sonarqube code coverage requires jacoco XML report
jacocoTestReport {
reports {
xml.required = true
}
}
tasks.sonarqube.dependsOn tasks.jacocoTestReport
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
credentials {
username nexusUser
password nexusPassword
}
url = project.hasProperty('nexusUrl') ? nexusUrl : ''
}
}
}