1
+ buildscript {
2
+ repositories {
3
+ mavenLocal() {
4
+ metadataSources {
5
+ mavenPom()
6
+ artifact()
7
+ }
8
+ }
9
+ mavenCentral()
10
+ }
11
+ dependencies {
12
+ classpath(" org.springframework.boot:spring-boot-gradle-plugin:${ springBootVersion} " )
13
+ classpath(" io.github.gradle-nexus:publish-plugin:1.0.0" )
14
+ }
15
+ }
16
+
17
+
1
18
plugins {
2
- id ' org.springframework.boot'
3
- id ' io.spring.dependency-management'
19
+ id ' org.springframework.boot' version " ${ springBootVersion} "
20
+ id ' io.spring.dependency-management' version ' 1.0.11.RELEASE'
21
+ // id "signing"
4
22
id ' maven-publish'
23
+ id " io.github.gradle-nexus.publish-plugin" version " 1.0.0"
5
24
id ' groovy'
6
25
}
7
26
27
+
8
28
apply plugin : " maven-publish"
29
+ apply plugin : ' signing'
30
+ apply plugin : ' io.github.gradle-nexus.publish-plugin'
31
+ apply plugin : ' groovy'
32
+ apply plugin : ' io.spring.dependency-management'
9
33
10
- // archivesBaseName = 'beapi-spring-boot-autoconfigure'
11
34
12
- java {
13
- withSourcesJar()
14
- }
35
+ description = " The Beapi Springboot Starter for API Automation; automates and simplifies almost all API functionality and security"
15
36
16
- description = " Starter for using Beapi's blah blah blah ... "
37
+ // archivesBaseName = 'beapi-spring-boot-autoconfigure'
17
38
18
39
bootJar {
19
40
enabled = false
20
41
}
21
42
22
- group = " ${ group} "
43
+ group = " io.beapi"
44
+ archivesBaseName = " spring-boot-starter-beapi"
23
45
version = " ${ version} "
24
46
25
47
sourceCompatibility = " ${ sourceCompatibility} "
26
48
49
+ publishing {
50
+ publications {
51
+ maven(MavenPublication ) {
52
+ from(components. java)
53
+ }
54
+ }
55
+ }
56
+
57
+
58
+ java {
59
+ withJavadocJar()
60
+ withSourcesJar()
61
+ }
62
+
63
+ repositories {
64
+ mavenCentral()
65
+ }
66
+
27
67
dependencies {
28
68
29
69
implementation(" org.springframework.boot:spring-boot-starter:${ springBootVersion} " ){
@@ -45,7 +85,7 @@ dependencies {
45
85
// implementation 'org.projectlombok:lombok:1.18.20'
46
86
implementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.9'
47
87
implementation ' org.json:json:20210307'
48
- implementation ' com.google.code.gson:gson:2.8.8 '
88
+ implementation ' com.google.code.gson:gson:2.8.9 '
49
89
50
90
// LOGGING
51
91
// implementation 'org.slf4j:slf4j-api:1.7.15'
@@ -54,7 +94,7 @@ dependencies {
54
94
// SECURITY
55
95
implementation " org.springframework.boot:spring-boot-starter-security:${ springBootVersion} "
56
96
implementation " com.fasterxml.jackson.core:jackson-core:2.12.0"
57
- implementation " com.fasterxml.jackson.core:jackson-databind:2.12.0 "
97
+ implementation " com.fasterxml.jackson.core:jackson-databind:2.13.1 "
58
98
implementation ' io.jsonwebtoken:jjwt:0.9.1'
59
99
60
100
// LOGGING FOR GRAFANA/ GRAPHITE / CARBON
@@ -102,32 +142,90 @@ dependencies {
102
142
103
143
}
104
144
105
- afterEvaluate {
106
-
107
- println (" Components: " + components* . name)
108
- println (" project : ${ rootProject.name} /${ project.name} " )
109
145
110
- publishing {
111
- repositories {
112
- maven {
113
- // name = "spring-boot-starter-beapi"
114
- url = " https://maven.pkg.github.com/orubel/spring-boot-starter-beapi"
115
- credentials {
116
- username = ' orubel'
117
- password = System . getenv(" GITHUB_TOKEN" )
146
+ project. plugins. withType(MavenPublishPlugin ). all {
147
+ PublishingExtension publishing = project. extensions. getByType(PublishingExtension )
148
+ publishing. publications. withType(MavenPublication ). all { mavenPublication ->
149
+ mavenPublication. pom {
150
+ name = " ${ project.group} :${ project.name} "
151
+ description = " The Beapi Springboot Starter for API Automation; automates and simplifies almost all API functionality and security"
152
+ url = " https://github.com/orubel/spring-boot-starter-beapi"
153
+ licenses {
154
+ license {
155
+ name = " Reciprocal Public License (RPL-1.5)"
156
+ url = " https://opensource.org/licenses/RPL-1.5"
118
157
}
119
158
}
120
- }
121
- publications {
122
- gpr(MavenPublication ) {
123
- // groupId = 'io.beapi'
124
- // artifactId = 'spring-boot-starter-beapi'
125
- // version = version
126
- from project. components. java
159
+ developers {
160
+ developer {
161
+ id = " orubel"
162
+ name = " Owen Rubel"
163
+ email = " orubel+spam@gmail.com"
164
+ }
165
+ }
166
+ scm {
167
+ connection = " https://github.com/orubel/spring-boot-starter-beapi.git"
168
+ developerConnection = " https://github.com/orubel/spring-boot-starter-beapi.git"
169
+ url = " https://github.com/orubel/spring-boot-starter-beapi"
127
170
}
128
171
}
129
172
}
173
+ }
130
174
175
+ nexusPublishing {
176
+ repositories {
177
+ sonatype {
178
+ username = System . getenv(" ORG_GRADLE_PROJECT_ossrhUsername" )
179
+ password = System . getenv(" ORG_GRADLE_PROJECT_ossrhPassword" )
180
+ nexusUrl. set(uri(" https://s01.oss.sonatype.org/service/local/" ))
181
+ snapshotRepositoryUrl. set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
182
+ }
183
+ }
184
+
185
+ // these are not strictly required. The default timeouts are set to 1 minute. But Sonatype can be really slow.
186
+ // If you get the error "java.net.SocketTimeoutException: timeout", these lines will help.
187
+ connectTimeout = Duration . ofMinutes(3 )
188
+ clientTimeout = Duration . ofMinutes(3 )
189
+ }
190
+
191
+
192
+
193
+ // artifacts {
194
+ // archives javadocJar, sourcesJar
195
+ // }
196
+
197
+ // signing {
198
+ // sign project.configurations.archives
199
+ // }
200
+
201
+ // task javadocJar(type: Jar) {
202
+ // classifier = 'javadoc'
203
+ // from javadoc
204
+ // }
205
+
206
+ // task sourcesJar(type: Jar) {
207
+ // classifier = 'sources'
208
+ // from sourceSets.main.allSource
209
+ // }
210
+
211
+ def hasSigningKey = System . getenv(" ORG_GRADLE_PROJECT_signingKeyId" ) || System . getenv(" ORG_GRADLE_PROJECT_signingKey" )
212
+ if (hasSigningKey) {
213
+ sign(project)
214
+ }
215
+ void sign (Project project ) {
216
+ project. signing {
217
+ required { project. gradle. taskGraph. hasTask(" publish" ) }
218
+ def signingKeyId = findProperty(" signingKeyId" )
219
+ def signingKey = findProperty(" signingKey" )
220
+ def signingPassword = findProperty(" signingPassword" )
221
+
222
+ if (signingKeyId) {
223
+ useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
224
+ } else if (signingKey) {
225
+ useInMemoryPgpKeys(signingKey, signingPassword)
226
+ }
227
+ sign publishing. publications. maven
228
+ }
131
229
}
132
230
133
231
0 commit comments