11import java.text.SimpleDateFormat
22
3- buildscript {
4- repositories {
5- mavenCentral()
6- }
7- }
83
94plugins {
10- id " com.jfrog.bintray" version " 1.8.4"
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"
1111}
1212
13- apply plugin : ' java'
14- apply plugin : ' groovy'
15- apply plugin : ' maven-publish'
16- apply plugin : ' com.jfrog.bintray'
17-
1813def getDevelopmentVersion () {
1914 def output = new StringBuilder ()
2015 def error = new StringBuilder ()
@@ -40,10 +35,9 @@ targetCompatibility = 1.8
4035
4136repositories {
4237 mavenCentral()
43- maven { url " http://dl.bintray.com/andimarek/graphql-java " }
38+ mavenLocal()
4439}
4540
46-
4741dependencies {
4842 compile " com.graphql-java:graphql-java:16.1"
4943
@@ -66,6 +60,12 @@ artifacts {
6660 archives javadocJar
6761}
6862
63+ test {
64+ testLogging {
65+ exceptionFormat = ' full'
66+ }
67+ }
68+
6969publishing {
7070 publications {
7171 maven(MavenPublication ) {
@@ -112,24 +112,24 @@ publishing {
112112 }
113113}
114114
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-scalars"
124- desc = ' A library fo extended scalars for graphql-java'
125- licenses = [' MIT' ]
126- vcsUrl = ' https://github.com/graphql-java/graphql-java-extended-scalars.git'
127- version {
128- released = new Date ()
129- vcsTag = project. version
130- gpg {
131- sign = true
132- }
115+ nexusPublishing {
116+ repositories {
117+ sonatype {
118+ username = System . env. MAVEN_CENTRAL_USER
119+ password = System . env. MAVEN_CENTRAL_PASSWORD
133120 }
134121 }
135122}
123+
124+ signing {
125+ def signingKey = System . env. MAVEN_CENTRAL_PGP_KEY
126+ useInMemoryPgpKeys(signingKey, " " )
127+ sign publishing. publications
128+ }
129+
130+
131+ // all publish tasks depend on the build task
132+ tasks. withType(PublishToMavenRepository ) {
133+ dependsOn build
134+ }
135+
0 commit comments