-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
108 lines (96 loc) · 3.63 KB
/
build.gradle
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("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
autoConfigure {
java {
languageVersion.set(JavaLanguageVersion.of(17))
vendorName.set("Cloudflight")
}
}
allprojects { p ->
group "io.cloudflight.platform.spring"
description "Cloudflight Platform for Spring Boot"
repositories {
mavenCentral()
}
configurations {
all {
exclude group: 'junit'
exclude group: 'org.junit.vintage'
}
}
if (p.plugins.hasPlugin(JavaLibraryPlugin)) {
java {
withJavadocJar()
}
}
if (p.subprojects.isEmpty() || p.name.endsWith("-bom")) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
p.afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
if (p.name.endsWith("-bom")) {
from components.getByName("javaPlatform")
} else {
from components.getByName("java")
}
pom {
name.set(getPublicationName(project))
description.set(project.description)
url.set("https://github.com/cloudflightio/cloudflight-platform-spring")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
inceptionYear.set("2022")
organization {
name.set("Cloudflight")
url.set("https://cloudflight.io")
}
developers {
developer {
id.set("cloudflightio")
name.set("Cloudflight Team")
email.set("[email protected]")
}
}
scm {
connection.set("scm:[email protected]:cloudflightio/cloudflight-platform-spring.git")
developerConnection.set("scm:[email protected]:cloudflightio/cloudflight-platform-spring.git")
url.set("https://github.com/cloudflightio/cloudflight-platform-spring")
}
}
}
}
}
signing {
setRequired {
System.getenv("PGP_SECRET") != null
}
useInMemoryPgpKeys(System.getenv("PGP_SECRET"), System.getenv("PGP_PASSPHRASE"))
sign(publishing.publications.getByName("maven"))
}
}
}
}
private static String getPublicationName(Project project) {
if (project == project.rootProject) {
return project.rootProject.name
} else {
return project.rootProject.name + " - " + project.name
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("MAVEN_USERNAME"))
password.set(System.getenv("MAVEN_PASSWORD"))
}
}
}