-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpublishing.gradle
More file actions
86 lines (79 loc) · 2.62 KB
/
publishing.gradle
File metadata and controls
86 lines (79 loc) · 2.62 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
// maven-specific publishing settings
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
scm {
connection "scm:git:$scmHttpsUrl"
developerConnection "scm:git:$scmSshUrl"
url "$scmProjectUrl"
}
}
def excludeProjects = [
'internal-docs'
]
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username = System.getenv('SONATYPE_USERNAME')
password = System.getenv('SONATYPE_PASSWORD')
}
}
}
subprojects { project ->
apply plugin: 'maven-publish'
apply plugin: 'signing'
if (project.file("build.gradle").exists() && !excludeProjects.contains(project.name)) {
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/commercetools/commercetools-sdk-java-v2")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
Maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId group
artifactId project.name
version version
pom {
name = project.name
description = project.description
developers {
developer {
id = "jenschude"
name = "Jens Schulze"
email = "jens.schulze@commercetools.com"
}
}
url = scmHttpsUrl
}
pom.withXml {
def root = asNode()
root.children().last() + pomConfig
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.Maven
}
tasks.withType(Sign) {
onlyIf { !version.toString().endsWith("SNAPSHOT") }
}
}
}