@@ -19,7 +19,7 @@ apply plugin: 'java'
1919apply plugin : ' eclipse'
2020apply plugin : ' org.springframework.boot'
2121apply plugin : ' io.spring.dependency-management'
22- apply plugin : ' maven'
22+ apply plugin : ' maven-publish '
2323apply plugin : ' jacoco'
2424
2525group = ' com.iexec.core'
@@ -28,6 +28,7 @@ targetCompatibility = 11
2828
2929
3030repositories {
31+ mavenLocal()
3132 mavenCentral()
3233 jcenter()
3334 maven {
@@ -37,23 +38,6 @@ repositories {
3738 maven { url " https://jitpack.io" }
3839}
3940
40- configurations {
41- springBootJar
42- libraryJar
43- }
44-
45- def LIBRARY_JAR_NAME = project. name + " -library"
46- jar {
47- enabled = true
48- baseName = LIBRARY_JAR_NAME
49- }
50-
51- // the project will create two artifacts: one spring boot executable and one library
52- artifacts {
53- springBootJar file : file(' build/libs/' + project. name + ' -' + version + ' .jar' )
54- libraryJar file : file(' build/libs/' + LIBRARY_JAR_NAME + ' -' + version + ' .jar' )
55- }
56-
5741ext {
5842 // https://github.com/spring-cloud/spring-cloud-openfeign/issues/171
5943 // Greenwich.SR2 is a patch for Greenwich.RELEASE
@@ -69,55 +53,50 @@ dependencyManagement {
6953
7054dependencies {
7155 // iexec
72- compile " com.iexec.common:iexec-common:$iexecCommonVersion "
73- // compile files("../iexec-common/build/libs/iexec-common-${iexecCommonVersion}.jar")
56+ implementation " com.iexec.common:iexec-common:$iexecCommonVersion "
7457
7558 // spring
76- compile (" org.springframework.boot:spring-boot-starter" ) {
59+ implementation (" org.springframework.boot:spring-boot-starter" ) {
7760 exclude group : ' org.springframework.boot' , module : ' spring-boot-starter-logging' // required for Graylog
7861 }
79- compile " org.springframework.boot:spring-boot-starter-web"
80- compile " org.springframework.boot:spring-boot-starter-data-mongodb"
81- compile " org.springframework.boot:spring-boot-starter-websocket"
82- compile " org.springframework.retry:spring-retry"
83- compile " org.springframework.boot:spring-boot-starter-aop"
84- compile " org.springframework.boot:spring-boot-starter-security"
85- compile " org.springframework.boot:spring-boot-starter-actuator"
86- compile " org.springframework.cloud:spring-cloud-starter-openfeign"
62+ implementation " org.springframework.boot:spring-boot-starter-web"
63+ implementation " org.springframework.boot:spring-boot-starter-data-mongodb"
64+ implementation " org.springframework.boot:spring-boot-starter-websocket"
65+ implementation " org.springframework.retry:spring-retry"
66+ implementation " org.springframework.boot:spring-boot-starter-aop"
67+ implementation " org.springframework.boot:spring-boot-starter-security"
68+ implementation " org.springframework.boot:spring-boot-starter-actuator"
69+ implementation " org.springframework.cloud:spring-cloud-starter-openfeign"
8770
8871 // NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
8972 implementation ' com.squareup.okhttp3:okhttp:4.3.1' // Web3j issue: https://github.com/web3j/web3j/issues/1180
9073 // NoSuchMethodError: 'byte[] kotlin.collections.ArraysKt.copyInto(byte[], byte[], int, int, int)'
9174 implementation ' org.jetbrains.kotlin:kotlin-stdlib:1.3.50' // https://stackoverflow.com/a/57907899
9275
93- testCompile " org.springframework.boot:spring-boot-starter-test"
76+ testImplementation " org.springframework.boot:spring-boot-starter-test"
9477
9578 // swagger
96- compile " io.springfox:springfox-swagger2:2.9.2"
97- compile " io.springfox:springfox-swagger-ui:2.9.2"
79+ implementation " io.springfox:springfox-swagger2:2.9.2"
80+ implementation " io.springfox:springfox-swagger-ui:2.9.2"
9881
9982 // jason web token
100- compile " io.jsonwebtoken:jjwt:0.7.0"
83+ implementation " io.jsonwebtoken:jjwt:0.7.0"
10184
10285 // expiring map
103- compile " net.jodah:expiringmap:0.5.8"
86+ implementation " net.jodah:expiringmap:0.5.8"
10487
10588 // ipfs
106- compile " com.github.ipfs:java-ipfs-http-client:1.2.3"
89+ implementation " com.github.ipfs:java-ipfs-http-client:1.2.3"
10790
108- // graylog
109- compile ' biz.paluch.logging:logstash-gelf:1.5.1'
91+ // graylog
92+ implementation ' biz.paluch.logging:logstash-gelf:1.5.1'
11093
111- compile ' io.micrometer:micrometer-registry-prometheus:1.1.5'
94+ implementation ' io.micrometer:micrometer-registry-prometheus:1.1.5'
11295
11396 // lombok
11497 compileOnly " org.projectlombok:lombok:1.18.2"
11598 annotationProcessor " org.projectlombok:lombok:1.18.2"
11699
117- // package cloud
118- springBootJar " io.packagecloud.maven.wagon:maven-packagecloud-wagon:0.0.6"
119- libraryJar " io.packagecloud.maven.wagon:maven-packagecloud-wagon:0.0.6"
120-
121100 // mongock
122101 implementation " com.github.cloudyrock.mongock:mongock-spring-v5:${ mongockVersion} "
123102 implementation " com.github.cloudyrock.mongock:mongodb-springdata-v2-driver:${ mongockVersion} "
@@ -129,16 +108,18 @@ dependencies {
129108 testImplementation ' org.awaitility:awaitility:4.0.1'
130109}
131110
132- jacoco {
133- toolVersion = " 0.8.3"
111+ jar {
112+ enabled = true
113+ archiveClassifier. set(' library' )
134114}
135115
136- jacocoTestReport {
137- reports. xml. enabled true
138- reports. xml. destination file(" ${ jacoco.reportsDir} /test/cov.xml" )
116+ test {
117+ useJUnitPlatform()
139118}
140119
141- // the test coverage report will be created just before the build
120+ jacoco {
121+ toolVersion = " 0.8.3"
122+ }
142123build. dependsOn jacocoTestReport
143124
144125def gitBranch = ' git name-rev --name-only HEAD' . execute(). text. trim()
@@ -157,39 +138,25 @@ project.ext.getNexusMaven = {
157138 }
158139}
159140
160- uploadSpringBootJar {
161- description ' Upload the executable jar version of the core'
162- repositories. mavenDeployer {
163- pom. groupId = project. group
164- pom. artifactId = project. name
165- pom. version = version
166- configuration = configurations. springBootJar
167- repository(url : getNexusMaven()) {
168- authentication(userName : project. nexusUser, password : project. nexusPassword)
141+ publishing {
142+ publications {
143+ maven(MavenPublication ) {
144+ artifact bootJar
145+ from components. java
169146 }
170147 }
171- }
172-
173- uploadLibraryJar {
174- description ' Upload the library jar version of the core'
175- repositories. mavenDeployer {
176- pom. groupId = project. group
177- pom. artifactId = LIBRARY_JAR_NAME
178- pom. version = version
179- configuration = configurations. libraryJar
180- repository(url : getNexusMaven()) {
181- authentication(userName : project. nexusUser, password : project. nexusPassword)
148+ repositories {
149+ maven {
150+ credentials {
151+ username nexusUser
152+ password nexusPassword
153+ }
154+ url getNexusMaven
182155 }
183156 }
184157}
185158
186- uploadLibraryJar. enabled = canUploadArchives
187- uploadSpringBootJar. enabled = canUploadArchives
188- uploadArchives. enabled = canUploadArchives
189-
190- uploadArchives. dependsOn uploadLibraryJar
191- uploadArchives. dependsOn uploadSpringBootJar
192-
159+ publish. enabled canUploadArchives
193160
194161import org.apache.tools.ant.filters.ReplaceTokens
195162
0 commit comments