-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathbuild.gradle
More file actions
108 lines (97 loc) · 3.72 KB
/
build.gradle
File metadata and controls
108 lines (97 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
id 'io.codearte.nexus-staging' version '0.21.1'
}
apply from: "../java_shared.gradle"
task ciTest( type: Test )
dependencies {
compile project(':cloudinary-core')
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.18.0'
testCompile group: 'org.hamcrest', name: 'java-hamcrest', version:'2.0.0.0'
testCompile group: 'pl.pragmatists', name: 'JUnitParams', version:'1.0.5'
testCompile group: 'junit', name: 'junit', version:'4.12'
compile(group: 'javax.servlet', name: 'jsp-api', version:'2.0') {
/* This dependency was originally in the Maven provided scope, but the project was not of type war.
This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
Please review and delete this closure when resolved. */
}
}
if (hasProperty("ossrhPassword")) {
signing {
sign configurations.archives
}
nexusStaging {
packageGroup = group
username = project.hasProperty("ossrhToken") ? project.ext["ossrhToken"] : ""
password = project.hasProperty("ossrhTokenPassword") ? project.ext["ossrhTokenPassword"] : ""
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'Cloudinary Taglib Library'
packaging = 'jar'
groupId = publishGroupId
artifactId = 'cloudinary-taglib'
description = publishDescription
url = githubUrl
licenses {
license {
name = licenseName
url = licenseUrl
}
}
developers {
developer {
id = developerId
name = developerName
email = developerEmail
}
}
scm {
connection = scmConnection
developerConnection = scmDeveloperConnection
url = scmUrl
}
}
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}
// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToSonatypeRepository {
dependsOn project.tasks.signArchives
}
}
}
}