@@ -2,14 +2,14 @@ import java.text.SimpleDateFormat
22
33
44plugins {
5- id " com.jfrog.bintray" version " 1.8.5"
5+ id ' java'
6+ id ' java-library'
7+ id ' maven'
8+ id ' maven-publish'
9+ id ' signing'
10+ id " io.github.gradle-nexus.publish-plugin" version " 1.0.0"
611}
712
8- apply plugin : ' java'
9- apply plugin : ' groovy'
10- apply plugin : ' maven-publish'
11- apply plugin : ' com.jfrog.bintray'
12-
1313def getDevelopmentVersion () {
1414 def output = new StringBuilder ()
1515 def error = new StringBuilder ()
@@ -25,16 +25,16 @@ def getDevelopmentVersion() {
2525
2626
2727def releaseVersion = System . properties. RELEASE_VERSION
28- println " Building version = " + releaseVersion
2928version = releaseVersion ? releaseVersion : getDevelopmentVersion()
29+ println " Building version = " + version
3030group = ' com.graphql-java'
3131
3232sourceCompatibility = 1.8
3333targetCompatibility = 1.8
3434
3535repositories {
3636 mavenCentral()
37- maven { url " http://dl.bintray.com/andimarek/graphql-java " }
37+ mavenLocal()
3838}
3939
4040
@@ -66,6 +66,12 @@ artifacts {
6666 archives javadocJar
6767}
6868
69+ test {
70+ testLogging {
71+ exceptionFormat = ' full'
72+ }
73+ }
74+
6975publishing {
7076 publications {
7177 maven(MavenPublication ) {
@@ -112,24 +118,24 @@ publishing {
112118 }
113119}
114120
115- bintray {
116- user = System . getenv(' BINTRAY_USER' )
117- key = System . getenv(' BINTRAY_API_KEY' )
118- publications = [' maven' ]
119- publish = true
120- pkg {
121- userOrg = ' graphql-java'
122- repo = ' graphql-java'
123- name = " graphql-java-extended-validation"
124- desc = ' A library fo extended validation for graphql-java'
125- licenses = [' MIT' ]
126- vcsUrl = ' https://github.com/graphql-java/graphql-java-extended-validation.git'
127- version {
128- released = new Date ()
129- vcsTag = project. version
130- gpg {
131- sign = true
132- }
121+ nexusPublishing {
122+ repositories {
123+ sonatype {
124+ username = System . env. MAVEN_CENTRAL_USER
125+ password = System . env. MAVEN_CENTRAL_PASSWORD
133126 }
134127 }
135128}
129+
130+ signing {
131+ def signingKey = System . env. MAVEN_CENTRAL_PGP_KEY
132+ useInMemoryPgpKeys(signingKey, " " )
133+ sign publishing. publications
134+ }
135+
136+
137+ // all publish tasks depend on the build task
138+ tasks. withType(PublishToMavenRepository ) {
139+ dependsOn build
140+ }
141+
0 commit comments