11plugins {
22 id ' java'
3- id ' io.freefair.lombok' version ' 6.6.1 '
4- id ' org.springframework.boot' version ' 2.6 .14'
5- id ' io.spring.dependency-management' version ' 1.1.0 '
3+ id ' io.freefair.lombok' version ' 8.2.2 '
4+ id ' org.springframework.boot' version ' 2.7 .14'
5+ id ' io.spring.dependency-management' version ' 1.1.3 '
66 id ' jacoco'
7- id ' org.sonarqube' version ' 3.3 '
7+ id ' org.sonarqube' version ' 4.2.1.3168 '
88 id ' maven-publish'
99}
1010
1111group = ' com.iexec.worker'
1212
1313ext {
14- springCloudVersion = ' 2021.0.5 '
14+ springCloudVersion = ' 2021.0.8 '
1515 dockerJavaVersion = ' 3.2.12'
1616 lombokVersion = ' 1.18.2'
1717}
@@ -34,22 +34,11 @@ repositories {
3434 password nexusPassword
3535 }
3636 }
37- maven {
38- url " https://nexus.intra.iex.ec/repository/maven-public/"
39- }
4037 maven {
4138 url " https://jitpack.io"
4239 }
4340}
4441
45- configurations {
46- all {
47- // Exclude JUnit 4. Only JUnit 5 is used
48- exclude group : ' junit' , module : ' junit'
49- exclude group : ' org.junit.vintage' , module : ' junit-vintage-engine'
50- }
51- }
52-
5342dependencyManagement {
5443 imports {
5544 mavenBom " org.springframework.cloud:spring-cloud-dependencies:${ springCloudVersion} "
@@ -66,28 +55,18 @@ dependencies {
6655 implementation " com.iexec.sms:iexec-sms-library:$iexecSmsVersion "
6756
6857 // spring
69- implementation(" org.springframework.boot:spring-boot-starter" ) {
70- exclude group : ' org.springframework.boot' , module : ' spring-boot-starter-logging' // required for Graylog
71- }
58+ implementation " org.springframework.boot:spring-boot-starter"
7259 implementation " org.springframework.boot:spring-boot-starter-actuator"
7360 implementation ' org.springframework.boot:spring-boot-starter-validation'
7461 implementation " org.springframework.boot:spring-boot-starter-web"
7562 implementation " org.springframework.boot:spring-boot-starter-websocket"
7663 implementation " org.springframework.cloud:spring-cloud-starter"
7764 implementation " org.springframework.cloud:spring-cloud-starter-openfeign"
7865 implementation " org.springframework.retry:spring-retry"
79- testImplementation " org.springframework.boot:spring-boot-starter-test"
80- testImplementation " org.mockito:mockito-inline:4.8.0" // activates mocking final classes/methods
8166
8267 // apache commons.lang3
8368 implementation ' org.apache.commons:commons-lang3'
8469
85- // Web3j issues, see core build.gradle
86- // NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
87- // Spring Boot dependencies BOM enforces okhttp3 3.14.9 in 2.6.X
88- // It is required to define the dependency version required by web3j until migration to at least Spring Boot 2.7.X
89- implementation ' com.squareup.okhttp3:okhttp:4.9.0' // Web3j issue: https://github.com/web3j/web3j/issues/1180
90-
9170 // Required for com.iexec.worker.feign.config.RestTemplateConfig
9271 implementation ' org.apache.httpcomponents:httpclient'
9372
@@ -98,9 +77,6 @@ dependencies {
9877 // Removes 'warning: unknown enum constant When.MAYBE'
9978 implementation ' com.google.code.findbugs:annotations:3.0.1'
10079
101- // graylog
102- implementation ' biz.paluch.logging:logstash-gelf:1.5.1'
103-
10480 // observability
10581 runtimeOnly ' io.micrometer:micrometer-registry-prometheus'
10682
@@ -110,6 +86,11 @@ dependencies {
11086 // expiring map
11187 implementation ' net.jodah:expiringmap:0.5.10'
11288
89+ // tests
90+ testImplementation " org.springframework.boot:spring-boot-starter-test"
91+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
92+ testImplementation " org.mockito:mockito-inline" // activates mocking final classes/methods
93+
11394 // awaitility
11495 testImplementation " org.awaitility:awaitility"
11596}
@@ -120,14 +101,6 @@ java {
120101 }
121102}
122103
123- // ./gradlew build -Pdev
124- def isDev = project. hasProperty(' dev' )
125-
126- jar {
127- enabled true
128- archiveClassifier. set(' library' )
129- }
130-
131104springBoot {
132105 buildInfo()
133106}
@@ -140,22 +113,14 @@ tasks.named("bootJar") {
140113}
141114
142115test {
143- useJUnitPlatform {
144- // Ignore slow tests in development
145- if (isDev) {
146- excludeTags ' slow'
147- }
148- }
116+ useJUnitPlatform()
149117}
150118
151- task itest {
119+ tasks . register( ' itest' ) {
152120 group ' Verification'
153121 description ' Runs the integration tests.'
154122}
155123
156- jacoco {
157- toolVersion = " 0.8.7"
158- }
159124// sonarqube code coverage requires jacoco XML report
160125jacocoTestReport {
161126 reports {
@@ -187,7 +152,7 @@ ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)
187152ext. gitShortCommit = ' git rev-parse --short=8 HEAD' . execute(). text. trim()
188153ext. ociImageName = ' local/' + [' bash' , ' -c' , ' basename $(git config --get remote.origin.url) .git' ]. execute(). text. trim()
189154
190- task buildImage ( type : Exec ) {
155+ tasks . register( ' buildImage ' , Exec ) {
191156 group ' Build'
192157 description ' Builds an OCI image from a Dockerfile.'
193158 dependsOn bootJar
0 commit comments