@@ -21,24 +21,17 @@ buildscript {
21
21
repositories {
22
22
mavenLocal()
23
23
mavenCentral()
24
- jcenter()
25
- maven { url " https://dl.bintray.com/graphql-java-kickstart/releases" }
26
24
maven { url " https://plugins.gradle.org/m2/" }
27
25
maven { url ' https://repo.spring.io/plugins-release' }
28
26
}
29
- dependencies {
30
- classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
31
- classpath ' net.researchgate:gradle-release:2.7.0'
32
- }
33
27
}
34
28
35
29
plugins {
36
- id ' net.researchgate.release' version ' 2.7.0'
37
30
id ' io.franzbecker.gradle-lombok' version ' 3.2.0' apply false
38
- id " com.jfrog.artifactory" version " 4.11.0" apply false
39
31
id " biz.aQute.bnd.builder" version " 5.1.2" apply false
40
32
id " org.sonarqube" version " 3.0"
41
33
id " jacoco"
34
+ id ' io.codearte.nexus-staging' version ' 0.30.0'
42
35
}
43
36
44
37
sonarqube {
@@ -55,16 +48,13 @@ subprojects {
55
48
apply plugin : ' org.sonarqube'
56
49
apply plugin : ' java'
57
50
apply plugin : ' maven-publish'
58
- apply plugin : " com.jfrog.bintray "
51
+ apply plugin : ' signing '
59
52
apply plugin : ' io.franzbecker.gradle-lombok'
60
- apply plugin : ' com.jfrog.artifactory'
61
53
62
54
repositories {
63
55
mavenLocal()
64
56
mavenCentral()
65
- jcenter()
66
- maven { url " https://dl.bintray.com/graphql-java-kickstart/releases" }
67
- maven { url " https://oss.jfrog.org/artifactory/oss-snapshot-local" }
57
+ maven { url " https://oss.sonatype.org/content/repositories/snapshots" }
68
58
maven { url " https://repo.spring.io/libs-milestone" }
69
59
}
70
60
@@ -101,142 +91,96 @@ subprojects {
101
91
from " LICENSE.md"
102
92
}
103
93
104
- task sourcesJar(type : Jar ) {
105
- dependsOn classes
106
- classifier ' sources'
107
- from sourceSets. main. allSource
94
+ java {
95
+ withSourcesJar()
96
+ withJavadocJar()
108
97
}
109
98
110
- task javadocJar( type : Jar , dependsOn : javadoc ) {
111
- classifier = ' javadoc '
112
- from javadoc . destinationDir
113
- }
99
+ if ( ! version . toString() . endsWith( ' -SNAPSHOT ' ) ) {
100
+ ext[ " signing.keyId " ] = System . env . SIGNING_KEY_ID
101
+ ext[ " signing.password " ] = System . env . SIGNING_PASSWORD
102
+ ext[ " signing.secretKeyRingFile " ] = System . env . SIGNING_SECRET_KEY_RING_FILE
114
103
115
- artifacts {
116
- archives sourcesJar
117
- archives javadocJar
104
+ signing {
105
+ sign publishing . publications
106
+ }
118
107
}
119
108
120
109
publishing {
121
110
publications {
122
- mainProjectPublication (MavenPublication ) {
111
+ mavenJava (MavenPublication ) {
123
112
version version
124
113
from components. java
125
114
126
- artifact sourcesJar {
127
- classifier " sources"
128
- }
129
- artifact javadocJar {
130
- classifier " javadoc"
115
+ versionMapping {
116
+ usage(' java-api' ) {
117
+ fromResolutionOf(' runtimeClasspath' )
118
+ }
119
+ usage(' java-runtime' ) {
120
+ fromResolutionResult()
121
+ }
131
122
}
132
123
133
- pom. withXml {
134
- asNode(). children(). last() + {
135
- resolveStrategy = Closure . DELEGATE_FIRST
136
- name PROJECT_NAME
137
- description ' relay.js-compatible GraphQL servlet'
138
- url ' https://github.com/graphql-java-kickstart/graphql-java-servlet'
139
- inceptionYear ' 2016'
140
-
141
- scm {
142
- url ' https://github.com/graphql-java-kickstart/graphql-java-servlet'
143
- connection ' scm:https://github.com/graphql-java-kickstart/graphql-java-servlet.git'
144
- developerConnection ' scm:git://github.com/graphql-java-kickstart/graphql-java-servlet.git'
145
- }
124
+ pom {
125
+ name = PROJECT_NAME
126
+ description = ' relay.js-compatible GraphQL servlet'
127
+ url = ' https://github.com/graphql-java-kickstart/graphql-java-servlet'
128
+ inceptionYear = ' 2016'
146
129
147
- licenses {
148
- license {
149
- name ' The Apache Software License, Version 2.0'
150
- url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
151
- distribution ' repo'
152
- }
153
- }
130
+ scm {
131
+ url = ' https://github.com/graphql-java-kickstart/graphql-java-servlet'
132
+ connection = ' scm:https://github.com/graphql-java-kickstart/graphql-java-servlet.git'
133
+ developerConnection = ' scm:git://github.com/graphql-java-kickstart/graphql-java-servlet.git'
134
+ }
154
135
155
- developers {
156
- developer {
157
- id ' yrashk'
158
- name ' Yurii Rashkovskii'
159
-
160
- }
161
- developer {
162
- id ' apottere'
163
- name ' Andrew Potter'
164
-
165
- }
136
+ licenses {
137
+ license {
138
+ name = ' The Apache Software License, Version 2.0'
139
+ url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
140
+ distribution = ' repo'
166
141
}
167
142
}
168
- // https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494/10
169
- asNode(). dependencies. ' *' . findAll() {
170
- it. scope. text() == ' runtime' && project. configurations. compile. allDependencies. find { dep ->
171
- dep. name == it. artifactId. text()
143
+
144
+ developers {
145
+ developer {
146
+ id = ' oliemansm'
147
+ name = ' Michiel Oliemans'
172
148
}
173
- }. each { it. scope* . value = ' compile' }
149
+ developer {
150
+ id = ' yrashk'
151
+ name = ' Yurii Rashkovskii'
152
+
153
+ }
154
+ developer {
155
+ id = ' apottere'
156
+ name = ' Andrew Potter'
157
+
158
+ }
159
+ }
174
160
}
175
161
}
176
162
}
177
- }
178
-
179
- bintray {
180
- user = System . env. BINTRAY_USER ?: project. findProperty(' BINTRAY_USER' ) ?: ' '
181
- key = System . env. BINTRAY_PASS ?: project. findProperty(' BINTRAY_PASS' ) ?: ' '
182
- publications = [' mainProjectPublication' ]
183
- publish = true
184
- pkg {
185
- repo = ' releases'
186
- name = PROJECT_NAME
187
- desc = PROJECT_DESC
188
- licenses = [PROJECT_LICENSE ]
189
- vcsUrl = PROJECT_GIT_REPO_URL
190
- userOrg = ' graphql-java-kickstart'
191
- version {
192
- name = project. version
193
- gpg {
194
- sign = true
163
+ repositories {
164
+ maven {
165
+ name ' ossrh'
166
+ if (version. toString(). endsWith(" -SNAPSHOT" )) {
167
+ url " https://oss.sonatype.org/content/repositories/snapshots/"
168
+ } else {
169
+ url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
195
170
}
196
- mavenCentralSync {
197
- user = System . env. OSS_USER_TOKEN_KEY ?: project. findProperty(' OSS_USER_TOKEN_KEY' ) ?: ' '
171
+ credentials {
172
+ username = System . env. OSS_USER_TOKEN_KEY ?: project. findProperty(' OSS_USER_TOKEN_KEY' ) ?: ' '
198
173
password = System . env. OSS_USER_TOKEN_PASS ?: project. findProperty(' OSS_USER_TOKEN_PASS' ) ?: ' '
199
174
}
200
175
}
201
176
}
202
177
}
203
-
204
- artifactory {
205
- contextUrl = ' http://oss.jfrog.org'
206
- publish {
207
- repository {
208
- if (project. version. endsWith(" -SNAPSHOT" )) {
209
- repoKey = ' oss-snapshot-local'
210
- } else {
211
- repoKey = ' oss-release-local'
212
- }
213
- username = System . env. BINTRAY_USER ?: project. findProperty(' BINTRAY_USER' ) ?: ' '
214
- password = System . env. BINTRAY_PASS ?: project. findProperty(' BINTRAY_PASS' ) ?: ' '
215
- }
216
- defaults {
217
- publications(' mainProjectPublication' )
218
- publishArtifacts = true
219
- publishPom = true
220
- }
221
- }
222
- resolve {
223
- repoKey = ' oss-snapshot-local'
224
- }
225
- clientConfig. info. setBuildNumber(System . getProperty(' build.number' ))
226
- }
227
178
}
228
179
}
229
180
230
- release {
231
- tagTemplate = ' v${version}'
232
- failOnPublishNeeded = false
233
- ignoredSnapshotDependencies = [' com.graphql-java-kickstart:graphql-java-servlet' ]
234
- }
235
-
236
- task build {
237
- dependsOn subprojects. findResults { it. tasks. findByName(' assemble' ) }
238
- dependsOn subprojects. findResults { it. tasks. findByName(' check' ) }
239
- dependsOn subprojects. findResults { it. tasks. findByName(' bintray' ) }
181
+ nexusStaging {
182
+ username = System . env. OSS_USER_TOKEN_KEY ?: project. findProperty(' OSS_USER_TOKEN_KEY' ) ?: ' '
183
+ password = System . env. OSS_USER_TOKEN_PASS ?: project. findProperty(' OSS_USER_TOKEN_PASS' ) ?: ' '
240
184
}
241
185
242
186
wrapper {
0 commit comments