@@ -64,11 +64,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
6464 archiveClassifier = ' javadoc'
6565}
6666
67- signing {
68- sign configurations. archives
69- }
70- tasks. withType(Sign )* . enabled = mavenCentralPublishingEnabled. toBoolean()
71-
7267publishing {
7368
7469 publications {
@@ -113,26 +108,9 @@ publishing {
113108 pom. withXml {
114109 def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
115110 writeTo(pomFile)
116- def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
117- artifact(pomAscFile) {
118- classifier = null
119- extension = ' pom.asc'
120- }
121111 }
122112 artifact sourceJar
123113 artifact javadocJar
124- project. tasks. signArchives. signatureFiles. each {
125- artifact(it) {
126- def matcher = it. file =~ / -(sources|javadoc)\. jar\. asc$/
127- if (matcher. find()){
128- classifier = matcher. group(1 )
129- }
130- else {
131- classifier = null
132- }
133- extension = ' jar.asc'
134- }
135- }
136114 }
137115 }
138116 repositories {
@@ -194,6 +172,18 @@ publishing {
194172 }
195173}
196174
175+ signing {
176+ sign publishing. publications. mavenCentralRelease
177+ }
178+ tasks. withType(Sign )* . enabled = mavenCentralPublishingEnabled. toBoolean()
179+
180+ def fixAscNames = { name ->
181+ if (name. contains(' pom' )) {
182+ " ${ project.property('mavenArtifactId')} -${ mavenMajorVersion} .${ mavenMinorVersion} .${ mavenPatchVersion} .pom.asc"
183+ } else {
184+ name. replace(' msgraph-sdk-java' , " ${ project.property('mavenArtifactId')} -${ mavenMajorVersion} .${ mavenMinorVersion} .${ mavenPatchVersion} " )
185+ }
186+ }
197187bintray {
198188 if (project. rootProject. file(' local.properties' ). exists()) {
199189 Properties properties = new Properties ()
@@ -202,6 +192,17 @@ bintray {
202192 key = properties. getProperty(' bintray.apikey' )
203193 }
204194 publications = [' mavenCentralRelease' ]
195+ filesSpec {
196+ from (' build/libs' ) {
197+ include ' msgraph-sdk-java*.jar.asc'
198+ rename fixAscNames
199+ }
200+ from (' build' ) {
201+ include ' generated-pom.xml.asc'
202+ rename fixAscNames
203+ }
204+ into " com/microsoft/graph/${ project.property('mavenArtifactId')} /${ mavenMajorVersion} .${ mavenMinorVersion} .${ mavenPatchVersion} /"
205+ }
205206 pkg {
206207 repo = ' Maven'
207208 name = project. property(' mavenArtifactId' )
0 commit comments