11plugins {
22 id ' java'
3- id ' org.springframework.boot' version ' 2.2.5.RELEASE '
3+ id ' org.springframework.boot' version ' 2.6.2 '
44 id ' io.spring.dependency-management' version ' 1.0.9.RELEASE'
55 id ' eclipse'
66 id ' jacoco'
77 id ' org.sonarqube' version ' 3.3'
88 id ' maven-publish'
99}
1010
11- group = ' com.iexec.result-proxy'
12- sourceCompatibility = 11
13- targetCompatibility = 11
11+ ext {
12+ springCloudVersion = ' 2021.0.0'
13+ gitBranch = ' git rev-parse --abbrev-ref HEAD' . execute(). text. trim()
14+ }
15+
16+ allprojects {
17+ group = ' com.iexec.result-proxy'
18+ sourceCompatibility = 11
19+ targetCompatibility = 11
1420
15- repositories {
16- mavenLocal()
17- mavenCentral()
18- maven {
19- url ' https://nexus.iex.ec/repository/maven-public/'
21+ if (gitBranch != ' main' && gitBranch != ' master' && ! (gitBranch ==~ ' (release|hotfix|support)/.*' )) {
22+ version + = ' -NEXT-SNAPSHOT'
2023 }
21- maven {
22- url ' https://jitpack.io'
24+
25+ repositories {
26+ mavenLocal()
27+ mavenCentral()
28+ maven {
29+ url ' https://nexus.intra.iex.ec/repository/maven-public/'
30+ }
31+ maven {
32+ url ' https://jitpack.io'
33+ }
2334 }
2435}
2536
@@ -29,10 +40,6 @@ configurations {
2940 }
3041}
3142
32- ext {
33- set(' springCloudVersion' , ' Hoxton.SR3' )
34- }
35-
3643dependencies {
3744 // iexec
3845 implementation " com.iexec.common:iexec-common:${ iexecCommonVersion} "
@@ -45,6 +52,7 @@ dependencies {
4552 implementation ' org.springframework.boot:spring-boot-starter-data-mongodb'
4653 implementation ' org.springframework.boot:spring-boot-starter-web'
4754 implementation ' org.springframework.cloud:spring-cloud-starter-openfeign'
55+ implementation " org.springframework.retry:spring-retry"
4856
4957 // test
5058 testImplementation(' org.springframework.boot:spring-boot-starter-test' ) {
@@ -57,9 +65,8 @@ dependencies {
5765 compileOnly ' org.projectlombok:lombok'
5866 annotationProcessor ' org.projectlombok:lombok'
5967
60- // swagger
61- implementation ' io.springfox:springfox-swagger2:2.9.2'
62- implementation ' io.springfox:springfox-swagger-ui:2.9.2'
68+ // Spring Doc
69+ implementation ' org.springdoc:springdoc-openapi-ui:1.6.3'
6370
6471 // ipfs
6572 implementation ' com.github.ipfs:java-ipfs-http-client:1.3.3'
@@ -77,6 +84,10 @@ dependencyManagement {
7784 }
7885}
7986
87+ springBoot {
88+ buildInfo()
89+ }
90+
8091test {
8192 useJUnitPlatform()
8293}
@@ -100,21 +111,6 @@ jacocoTestReport {
100111tasks. test. finalizedBy tasks. jacocoTestReport
101112tasks. sonarqube. dependsOn tasks. jacocoTestReport
102113
103- // ######################
104- // # create version #
105- // ######################
106-
107- task createVersion (type : Exec ) {
108- description ' Set version in application.yml'
109- commandLine(' sh' , ' -c' , " sed -i 's/^version.*/version: ${ version} /' src/main/resources/application.yml" )
110- }
111-
112- compileJava. dependsOn createVersion
113-
114- // ######################
115- // # upload archive #
116- // ######################
117-
118114publishing {
119115 publications {
120116 maven(MavenPublication ) {
@@ -133,14 +129,14 @@ publishing {
133129 }
134130}
135131
136- ext. bootJarPath = relativePath(tasks. bootJar. outputs. files. singleFile)
132+ ext. jarPathForOCI = relativePath(tasks. bootJar. outputs. files. singleFile)
137133ext. gitShortCommit = ' git rev-parse --short=8 HEAD' . execute(). text. trim()
138134ext. ociImageName = ' local/' + [' bash' , ' -c' , ' basename $(git config --get remote.origin.url) .git' ]. execute(). text. trim()
139135
140136task buildImage (type : Exec ) {
141137 group ' Build'
142138 description ' Builds an OCI image from a Dockerfile.'
143139 dependsOn tasks. bootJar
144- commandLine (" sh" , " -c" , " docker build --build-arg spring_boot_jar= $b ootJarPath -t $ociImageName :$gitShortCommit ."
140+ commandLine (" sh" , " -c" , " docker build --build-arg jar= $j arPathForOCI -t $ociImageName :$gitShortCommit ."
145141 + " && docker tag $ociImageName :$gitShortCommit $ociImageName :dev" )
146142}
0 commit comments