@@ -21,24 +21,17 @@ buildscript {
2121 repositories {
2222 mavenLocal()
2323 mavenCentral()
24- jcenter()
25- maven { url " https://dl.bintray.com/graphql-java-kickstart/releases" }
2624 maven { url " https://plugins.gradle.org/m2/" }
2725 maven { url ' https://repo.spring.io/plugins-release' }
2826 }
29- dependencies {
30- classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
31- classpath ' net.researchgate:gradle-release:2.7.0'
32- }
3327}
3428
3529plugins {
36- id ' net.researchgate.release' version ' 2.7.0'
3730 id ' io.franzbecker.gradle-lombok' version ' 3.2.0' apply false
38- id " com.jfrog.artifactory" version " 4.11.0" apply false
3931 id " biz.aQute.bnd.builder" version " 5.1.2" apply false
4032 id " org.sonarqube" version " 3.0"
4133 id " jacoco"
34+ id ' io.codearte.nexus-staging' version ' 0.30.0'
4235}
4336
4437sonarqube {
@@ -55,16 +48,13 @@ subprojects {
5548 apply plugin : ' org.sonarqube'
5649 apply plugin : ' java'
5750 apply plugin : ' maven-publish'
58- apply plugin : " com.jfrog.bintray "
51+ apply plugin : ' signing '
5952 apply plugin : ' io.franzbecker.gradle-lombok'
60- apply plugin : ' com.jfrog.artifactory'
6153
6254 repositories {
6355 mavenLocal()
6456 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" }
6858 maven { url " https://repo.spring.io/libs-milestone" }
6959 }
7060
@@ -101,142 +91,96 @@ subprojects {
10191 from " LICENSE.md"
10292 }
10393
104- task sourcesJar(type : Jar ) {
105- dependsOn classes
106- classifier ' sources'
107- from sourceSets. main. allSource
94+ java {
95+ withSourcesJar()
96+ withJavadocJar()
10897 }
10998
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
114103
115- artifacts {
116- archives sourcesJar
117- archives javadocJar
104+ signing {
105+ sign publishing . publications
106+ }
118107 }
119108
120109 publishing {
121110 publications {
122- mainProjectPublication (MavenPublication ) {
111+ mavenJava (MavenPublication ) {
123112 version version
124113 from components. java
125114
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+ }
131122 }
132123
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'
146129
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+ }
154135
155- developers {
156- developer {
157- id ' yrashk'
158- name ' Yurii Rashkovskii'
159- email ' yrashk@gmail.com'
160- }
161- developer {
162- id ' apottere'
163- name ' Andrew Potter'
164- email ' apottere@gmail.com'
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'
166141 }
167142 }
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'
172148 }
173- }. each { it. scope* . value = ' compile' }
149+ developer {
150+ id = ' yrashk'
151+ name = ' Yurii Rashkovskii'
152+ email = ' yrashk@gmail.com'
153+ }
154+ developer {
155+ id = ' apottere'
156+ name = ' Andrew Potter'
157+ email = ' apottere@gmail.com'
158+ }
159+ }
174160 }
175161 }
176162 }
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"
195170 }
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' ) ?: ' '
198173 password = System . env. OSS_USER_TOKEN_PASS ?: project. findProperty(' OSS_USER_TOKEN_PASS' ) ?: ' '
199174 }
200175 }
201176 }
202177 }
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- }
227178 }
228179}
229180
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' ) ?: ' '
240184}
241185
242186wrapper {
0 commit comments