1-
21plugins {
3- id ' java-library'
4- id ' com.diffplug.spotless' version ' 6.25.0'
5- id ' signing'
6- id ' maven-publish'
2+ id ' com.diffplug.spotless' version ' 6.25.0' apply false
73 id ' io.github.gradle-nexus.publish-plugin' version ' 1.3.0'
84 id ' net.researchgate.release' version ' 3.0.2'
95}
@@ -12,58 +8,52 @@ wrapper {
128 gradleVersion = ' 7.6.2'
139}
1410
15- group = ' org.gitlab4j'
16-
17- dependencies {
18- api ' jakarta.activation:jakarta.activation-api:2.1.1'
19- api ' org.glassfish.jersey.inject:jersey-hk2:3.1.1'
20- api ' org.glassfish.jersey.core:jersey-client:3.1.1'
21- api ' org.glassfish.jersey.connectors:jersey-apache-connector:3.1.1'
22- api ' org.glassfish.jersey.media:jersey-media-multipart:3.1.1'
23- api ' org.glassfish.jersey.media:jersey-media-json-jackson:3.1.1'
24- api ' jakarta.servlet:jakarta.servlet-api:6.0.0'
25- testImplementation ' org.mockito:mockito-core:5.2.0'
26- testImplementation ' org.mockito:mockito-junit-jupiter:5.2.0'
27- testImplementation ' org.hamcrest:hamcrest-all:1.3'
28- testImplementation ' uk.org.webcompere:system-stubs-jupiter:2.0.2'
29- testImplementation " org.junit.jupiter:junit-jupiter-api:5.10.4"
30- testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine:5.10.4"
31- }
11+ String groupId = ' org.gitlab4j'
3212
33- signing {
34- useGpgCmd()
35- sign(publishing. publications)
36- }
13+ subprojects {
14+ apply plugin : ' java-library'
15+ apply plugin : ' signing'
16+ apply plugin : ' com.diffplug.spotless'
17+ apply plugin : ' maven-publish'
3718
38- tasks. withType(Sign ) {
39- onlyIf {
40- project. hasProperty(' signing.gnupg.keyName' )
19+ group = groupId
20+
21+ signing {
22+ useGpgCmd()
23+ sign(publishing. publications)
4124 }
42- }
4325
44- java {
45- withJavadocJar()
46- withSourcesJar()
26+ tasks. withType(Sign ) {
27+ onlyIf {
28+ project. hasProperty(' signing.gnupg.keyName' )
29+ }
30+ }
31+
32+ java {
33+ withJavadocJar()
34+ withSourcesJar()
4735
48- compileJava. options. encoding = " UTF-8"
49- toolchain {
50- languageVersion = JavaLanguageVersion . of(11 )
36+ compileJava. options. encoding = " UTF-8"
37+ toolchain {
38+ languageVersion = JavaLanguageVersion . of(11 )
39+ }
5140 }
52- }
5341
54- tasks. named(' test' ) {
55- useJUnitPlatform()
56- }
42+ spotless {
43+ java {
44+ palantirJavaFormat()
45+ importOrder ' java' , ' javax' , ' jakarta' , ' org' , ' com' , ' '
46+ removeUnusedImports()
47+ }
48+ }
5749
58- repositories {
59- mavenCentral()
60- }
50+ repositories {
51+ // mavenLocal()
52+ mavenCentral()
53+ }
6154
62- spotless {
63- java {
64- palantirJavaFormat()
65- importOrder ' java' , ' javax' , ' jakarta' , ' org' , ' com' , ' '
66- removeUnusedImports()
55+ tasks. named(' test' ) {
56+ useJUnitPlatform()
6757 }
6858}
6959
@@ -78,51 +68,10 @@ nexusPublishing {
7868 }
7969}
8070
81- publishing {
82- publications {
83- mavenJava(MavenPublication ) {
84- pom {
85- name = ' GitLab4J-API - GitLab API Java Client'
86- description = ' GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.'
87- packaging = ' jar'
88- url = ' https://' + " $githubRepositoryOwner " + ' .github.io/' + " $githubRepositoryName " + ' /'
89- licenses {
90- license {
91- name = ' The MIT License (MIT)'
92- url = ' http://opensource.org/licenses/MIT'
93- distribution = ' repo'
94- }
95- }
96- developers {
97- developer {
98- id = ' gmessner'
99- name = ' Greg Messner'
100- email = ' greg@messners.com'
101- }
102- developer {
103- id = ' gdesaintmartinlacaze'
104- name = ' Gautier de Saint Martin Lacaze'
105- email = ' gautier@jabby-techs.fr'
106- }
107- developer {
108- url = ' https://github.com/orgs/' + " $githubRepositoryOwner " + ' /people'
109- }
110- }
111- scm {
112- connection = ' scm:git:https://github.com/' + " $githubRepositoryOwner " + ' /' + " $githubRepositoryName " + ' .git'
113- developerConnection = ' scm:git:https://github.com/' + " $githubRepositoryOwner " + ' /' + " $githubRepositoryName " + ' .git'
114- url = ' https://github.com/' + " $githubRepositoryOwner " + ' /' + " $githubRepositoryName " + ' /'
115- }
116- }
117- from components. java
118- }
119- }
120- }
121-
12271release {
12372 buildTasks = [' doRelease' ]
12473 git {
125- requireBranch. set(' 6.x ' )
74+ requireBranch. set(' main ' )
12675 }
12776}
12877
@@ -152,13 +101,13 @@ def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
152101 }
153102}
154103
155- tasks . register( ' doRelease' ) {
104+ task doRelease {
156105 dependsOn(
157- checkLastVersionValueTask,
158- ' initializeSonatypeStagingRepository' ,
159- ' clean' ,
160- ' build' ,
161- project. getTasksByName(' publishToSonatype' , true )
106+ checkLastVersionValueTask,
107+ ' initializeSonatypeStagingRepository' ,
108+ ' clean' ,
109+ ' build' ,
110+ project. getTasksByName(' publishToSonatype' , true )
162111 )
163112}
164113
0 commit comments