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
1111ext {
1212 openFeignVersion = ' 11.10'
13+ testContainersVersion = ' 1.19.0'
1314}
1415
1516if (! project. hasProperty(' gitBranch' )) {
@@ -32,9 +33,6 @@ allprojects {
3233 password nexusPassword
3334 }
3435 }
35- maven {
36- url " https://nexus.intra.iex.ec/repository/maven-public/"
37- }
3836 maven {
3937 url " https://jitpack.io"
4038 }
@@ -46,31 +44,35 @@ allprojects {
4644 }
4745}
4846
47+ sourceSets {
48+ itest {
49+ java {
50+ compileClasspath + = main. output + test. output
51+ runtimeClasspath + = main. output + test. output
52+ }
53+ }
54+ }
55+
4956configurations {
5057 itestRuntime. extendsFrom testRuntime
5158 itestImplementation. extendsFrom testImplementation
5259}
5360
5461dependencies {
55- // Spring Doc
56- implementation ' org.springdoc:springdoc-openapi-ui:1.6.3'
57-
62+ // Spring framework
5863 implementation ' org.springframework.boot:spring-boot-starter-actuator'
5964 implementation ' org.springframework.boot:spring-boot-starter-data-mongodb'
6065 implementation ' org.springframework.boot:spring-boot-starter-security'
6166 implementation ' org.springframework.boot:spring-boot-starter-validation'
6267 implementation ' org.springframework.boot:spring-boot-starter-web'
6368
69+ // Spring Doc
70+ implementation ' org.springdoc:springdoc-openapi-ui:1.6.3'
71+
6472 // iexec
6573 implementation " com.iexec.commons:iexec-commons-poco:$iexecCommonsPocoVersion "
6674 implementation " com.iexec.common:iexec-common:$iexecCommonVersion "
6775
68- // web3j bug required
69- // NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
70- // Spring Boot dependencies BOM enforces okhttp3 3.14.9 in 2.6.X
71- // It is required to define the dependency version required by web3j until migration to at least Spring Boot 2.7.X
72- implementation ' com.squareup.okhttp3:okhttp:4.9.0' // Web3j issue: https://github.com/web3j/web3j/issues/1180
73-
7476 // feign
7577 implementation " io.github.openfeign:feign-jackson:$openFeignVersion "
7678 implementation " io.github.openfeign:feign-slf4j:$openFeignVersion "
@@ -82,9 +84,10 @@ dependencies {
8284 implementation project(' :iexec-blockchain-adapter-api-library' )
8385
8486 testImplementation ' org.springframework.boot:spring-boot-starter-test'
87+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
8588 testImplementation ' org.awaitility:awaitility'
8689
87- itestImplementation ' org.testcontainers:junit-jupiter:1.18.1 '
90+ itestImplementation " org.testcontainers:junit-jupiter:$t estContainersVersion "
8891}
8992
9093springBoot {
@@ -98,15 +101,6 @@ tasks.named("bootJar") {
98101 }
99102}
100103
101- sourceSets {
102- itest {
103- java {
104- compileClasspath + = main. output + test. output
105- runtimeClasspath + = main. output + test. output
106- }
107- }
108- }
109-
110104tasks. register(" itest" , Test ) {
111105 doFirst {
112106 exec {
@@ -119,13 +113,6 @@ tasks.register("itest", Test) {
119113 classpath = sourceSets. itest. runtimeClasspath
120114}
121115
122- jar {
123- enabled = true
124- archiveClassifier. set(' library' )
125- from sourceSets. main. allSource
126- duplicatesStrategy = ' exclude'
127- }
128-
129116publishing {
130117 publications {
131118 maven(MavenPublication ) {
@@ -149,9 +136,6 @@ tasks.withType(Test).configureEach {
149136 useJUnitPlatform()
150137}
151138
152- jacoco {
153- toolVersion = " 0.8.7"
154- }
155139// sonarqube code coverage requires jacoco XML report
156140jacocoTestReport {
157141 reports {
@@ -164,7 +148,7 @@ ext.jarPathForOCI = relativePath(tasks.bootJar.outputs.files.singleFile)
164148ext. gitShortCommit = ' git rev-parse --short=8 HEAD' . execute(). text. trim()
165149ext. ociImageName = ' local/' + [' bash' , ' -c' , ' basename $(git config --get remote.origin.url) .git' ]. execute(). text. trim()
166150
167- task buildImage ( type : Exec ) {
151+ tasks . register( ' buildImage ' , Exec ) {
168152 group ' Build'
169153 description ' Builds an OCI image from a Dockerfile.'
170154 dependsOn bootJar
0 commit comments