-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
171 lines (141 loc) · 4.14 KB
/
build.gradle.kts
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import java.util.Base64
plugins {
`java-library`
`maven-publish`
signing
id("io.spring.dependency-management") version "1.1.7"
}
group = "io.jaconi"
version = "1.1.25"
if (project.properties["release"] != "true") {
project.version = "${project.version}-SNAPSHOT"
}
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.1")
}
}
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.projectlombok:lombok")
compileOnly("org.projectlombok:lombok")
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.amqp:spring-rabbit")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.testcontainers:rabbitmq:1.20.4")
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
tasks.withType<Test> {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
repositories {
maven {
credentials {
// Configure by setting the ORG_GRADLE_PROJECT_ossrhUsername environment variable.
val ossrhUsername: String? by project
username = ossrhUsername
// Configure by setting the ORG_GRADLE_PROJECT_ossrhPassword environment variable.
val ossrhPassword: String? by project
password = ossrhPassword
}
url = if (version.endsWith("-SNAPSHOT")) {
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
} else {
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
}
}
pom {
name.set("Spring RabbitMQ Retry")
description.set("Retries and exponential backoff for Spring AMQP.")
url.set("https://github.com/jaconi-io/spring-rabbitmq-retry")
inceptionYear.set("2023")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
distribution.set("repo")
comments.set("MIT License")
}
}
organization {
name.set("jaconi GmbH")
url.set("https://jaconi.io")
}
developers {
developer {
name.set("Julian Nodorp")
email.set("jnodorp@jaconi.io")
organization.set("jaconi GmbH")
organizationUrl.set("https://jaconi.io")
}
developer {
name.set("Gerrit Schlüter")
email.set("gschlueter@jaconi.io")
organization.set("jaconi GmbH")
organizationUrl.set("https://jaconi.io")
}
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/jaconi-io/spring-rabbitmq-retry/issues")
}
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/jaconi-io/spring-rabbitmq-retry/actions")
}
scm {
connection.set("scm:git:https://github.com/jaconi-io/spring-rabbitmq-retry.git")
developerConnection.set("scm:git:ssh://github.com:jaconi-io/spring-rabbitmq-retry.git")
url.set("https://github.com/jaconi-io/spring-rabbitmq-retry/tree/main")
}
}
}
}
}
signing {
// Configure by setting the ORG_GRADLE_PROJECT_signingKey environment variable.
val signingKey: String? by project
// Configure by setting the ORG_GRADLE_PROJECT_signingPassword environment variable.
val signingPassword: String? by project
useInMemoryPgpKeys(base64DecodeIfEncoded(signingKey), signingPassword)
isRequired = gradle.taskGraph.hasTask("publish")
sign(publishing.publications["maven"])
}
/**
* Base64 decode an input. If the input is not Base64 encoded, return the input.
*/
fun base64DecodeIfEncoded(s: String?): String? {
if (s == null) {
return null
}
return try {
String(Base64.getDecoder().decode(s))
} catch (_: IllegalArgumentException) {
s
}
}