11plugins {
22 id ' java'
33 id ' com.github.node-gradle.node' version ' 2.2.4'
4+ id ' signing'
45 id ' maven-publish'
5- id ' com.jfrog.bintray' version ' 1.8.5'
66}
77
8- group = ' io.github.stavshamir '
9- version = ' 0.0.2 '
8+ group = ' io.github.springwolf '
9+ version = ' 0.1.1 ' + ( Boolean . valueOf( System . getProperty( ' snapshot ' )) ? ' -SNAPSHOT ' : ' ' )
1010sourceCompatibility = ' 1.8'
1111
1212node {
@@ -38,6 +38,9 @@ artifacts {
3838 archives sourcesJar
3939}
4040
41+ signing {
42+ sign configurations. archives
43+ }
4144
4245def pomConfig = {
4346 licenses {
@@ -62,7 +65,7 @@ def pomConfig = {
6265
6366publishing {
6467 publications {
65- mavenPublication (MavenPublication ) {
68+ mavenJava (MavenPublication ) {
6669 artifact jar
6770
6871 artifact sourcesJar {
@@ -78,26 +81,46 @@ publishing {
7881 root. appendNode(' name' , ' springwolf-ui' )
7982 root. appendNode(' url' , ' https://github.com/springwolf/springwolf-ui' )
8083 root. children(). last() + pomConfig
84+
85+ def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
86+ writeTo(pomFile)
87+ def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
88+ artifact(pomAscFile) {
89+ classifier = null
90+ extension = ' pom.asc'
91+ }
92+ }
93+
94+ project. tasks. signArchives. signatureFiles. each {
95+ artifact(it) {
96+ def matcher = it. file =~ / -(sources|javadoc)\. jar\. asc$/
97+ if (matcher. find()) {
98+ classifier = matcher. group(1 )
99+ } else {
100+ classifier = null
101+ }
102+ extension = ' jar.asc'
103+ }
81104 }
82105 }
83106 }
84- }
85107
86- bintray {
87- user = System . getProperty(' bintray.user' )
88- key = System . getProperty(' bintray.key' )
89- publications = [' mavenPublication' ]
90-
91- pkg {
92- repo = ' springwolf'
93- name = ' springwolf-ui'
94- userOrg = ' stavshamir'
95- licenses = [' Apache-2.0' ]
96- vcsUrl = ' https://github.com/springwolf/springwolf-ui.git'
97- version {
98- name = project. version
99- desc = ' Web UI for Springwolf'
100- released = new Date ()
108+ repositories {
109+ maven {
110+ url ' https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
111+ credentials {
112+ username = ossrhUsername
113+ password = ossrhPassword
114+ }
115+ }
116+ }
117+
118+ model {
119+ tasks. publishMavenJavaPublicationToMavenLocal {
120+ dependsOn project. tasks. signArchives
121+ }
122+ tasks. publishMavenJavaPublicationToMavenRepository {
123+ dependsOn project. tasks. signArchives
101124 }
102125 }
103126}
0 commit comments