1
-
2
1
plugins {
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
7
3
id ' io.github.gradle-nexus.publish-plugin' version ' 1.3.0'
8
4
id ' net.researchgate.release' version ' 3.0.2'
9
5
}
@@ -12,58 +8,52 @@ wrapper {
12
8
gradleVersion = ' 7.6.2'
13
9
}
14
10
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'
32
12
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'
37
18
38
- tasks. withType(Sign ) {
39
- onlyIf {
40
- project. hasProperty(' signing.gnupg.keyName' )
19
+ group = groupId
20
+
21
+ signing {
22
+ useGpgCmd()
23
+ sign(publishing. publications)
41
24
}
42
- }
43
25
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()
47
35
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
+ }
51
40
}
52
- }
53
41
54
- tasks. named(' test' ) {
55
- useJUnitPlatform()
56
- }
42
+ spotless {
43
+ java {
44
+ palantirJavaFormat()
45
+ importOrder ' java' , ' javax' , ' jakarta' , ' org' , ' com' , ' '
46
+ removeUnusedImports()
47
+ }
48
+ }
57
49
58
- repositories {
59
- mavenCentral()
60
- }
50
+ repositories {
51
+ // mavenLocal()
52
+ mavenCentral()
53
+ }
61
54
62
- spotless {
63
- java {
64
- palantirJavaFormat()
65
- importOrder ' java' , ' javax' , ' jakarta' , ' org' , ' com' , ' '
66
- removeUnusedImports()
55
+ tasks. named(' test' ) {
56
+ useJUnitPlatform()
67
57
}
68
58
}
69
59
@@ -78,51 +68,10 @@ nexusPublishing {
78
68
}
79
69
}
80
70
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
-
101
- }
102
- developer {
103
- id = ' gdesaintmartinlacaze'
104
- name = ' Gautier de Saint Martin Lacaze'
105
-
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
-
122
71
release {
123
72
buildTasks = [' doRelease' ]
124
73
git {
125
- requireBranch. set(' 6.x ' )
74
+ requireBranch. set(' main ' )
126
75
}
127
76
}
128
77
@@ -152,13 +101,13 @@ def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
152
101
}
153
102
}
154
103
155
- tasks . register( ' doRelease' ) {
104
+ task doRelease {
156
105
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 )
162
111
)
163
112
}
164
113
0 commit comments