11plugins {
22 id ' java-library'
3- id ' signing'
4- id ' maven-publish'
5- id ' io.codearte.nexus-staging' version ' 0.21.1'
63}
74
85apply from : " ../java_shared.gradle"
6+ apply from : " ../publish.gradle"
97
108task ciTest ( type : Test ) {
119 useJUnit {
@@ -27,87 +25,4 @@ dependencies {
2725 testCompile group : ' junit' , name : ' junit' , version : ' 4.12'
2826}
2927
30- if (hasProperty(" ossrhPassword" )) {
31-
32- signing {
33- sign configurations. archives
34- }
35-
36- nexusStaging {
37- packageGroup = group
38- username = project. hasProperty(" ossrhToken" ) ? project. ext[" ossrhToken" ] : " "
39- password = project. hasProperty(" ossrhTokenPassword" ) ? project. ext[" ossrhTokenPassword" ] : " "
40- }
41-
42- publishing {
43- publications {
44- mavenJava(MavenPublication ) {
45- from components. java
46- artifact sourcesJar
47- artifact javadocJar
48- pom {
49- name = ' Cloudinary Apache HTTP 5 Library'
50- packaging = ' jar'
51- groupId = publishGroupId
52- artifactId = ' cloudinary-http5'
53- description = publishDescription
54- url = githubUrl
55- licenses {
56- license {
57- name = licenseName
58- url = licenseUrl
59- }
60- }
61-
62- developers {
63- developer {
64- id = developerId
65- name = developerName
66- email = developerEmail
67- }
68- }
69- scm {
70- connection = scmConnection
71- developerConnection = scmDeveloperConnection
72- url = scmUrl
73- }
74- }
75-
76- pom. withXml {
77- def pomFile = file(" ${ project.buildDir} /generated-pom.xml" )
78- writeTo(pomFile)
79- def pomAscFile = signing. sign(pomFile). signatureFiles[0 ]
80- artifact(pomAscFile) {
81- classifier = null
82- extension = ' pom.asc'
83- }
84- }
85-
86- // create the signed artifacts
87- project. tasks. signArchives. signatureFiles. each {
88- artifact(it) {
89- def matcher = it. file =~ / -(sources|javadoc)\. jar\. asc$/
90- if (matcher. find()) {
91- classifier = matcher. group(1 )
92- } else {
93- classifier = null
94- }
95- extension = ' jar.asc'
96- }
97- }
98- }
99- }
100-
101- model {
102- tasks. generatePomFileForMavenJavaPublication {
103- destination = file(" $buildDir /generated-pom.xml" )
104- }
105- tasks. publishMavenJavaPublicationToMavenLocal {
106- dependsOn project. tasks. signArchives
107- }
108- tasks. publishMavenJavaPublicationToSonatypeRepository {
109- dependsOn project. tasks. signArchives
110- }
111- }
112- }
113- }
28+ // Publishing configuration moved to ../publish.gradle
0 commit comments