-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
216 lines (190 loc) · 7.32 KB
/
Copy pathbuild.gradle
File metadata and controls
216 lines (190 loc) · 7.32 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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'org.jreleaser' version '1.24.0'
}
apply from: 'dependencies.gradle'
apply from: 'gradle/repositories.gradle'
// VERSION STRATEGY
//
// Manual version management - update this for each release
// Format: MAJOR.MINOR.PATCH for releases, MAJOR.MINOR.PATCH-SNAPSHOT for development
//
// Example: 0.1.0-SNAPSHOT for development, 0.1.0 for release
//
// DO NOT FORGET TO DOCUMENT CHANGES IN CHANGELOG.md (create if needed)
//
def otto_config_version = "0.1.7" // <--- SET AND UPDATE VERSION HERE
group = 'de.otto.config'
version = otto_config_version
apply from: 'gradle/maven.gradle'
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
dependencies {
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
// Spring dependencies as compileOnly
compileOnly "org.springframework:spring-context:${springContextVersion}"
compileOnly "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}"
// Helidon dependencies as compileOnly
compileOnly "io.helidon.microprofile.scheduling:helidon-microprofile-scheduling:${helidonVersion}"
compileOnly "io.helidon.config:helidon-config:${helidonVersion}"
// Add Spring Boot testing starter
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
// Other dependencies
implementation "software.amazon.awssdk:sts:${awsSdkVersion}"
api "software.amazon.awssdk:appconfigdata:${awsSdkVersion}"
api "software.amazon.awssdk:secretsmanager:${awsSdkVersion}"
api "software.amazon.awssdk:ssm:${awsSdkVersion}"
api "software.amazon.awssdk:sqs:${awsSdkVersion}"
api "com.google.guava:guava:33.1.0-jre"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
// Testing dependencies
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit5Version}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junit5Version}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit5Version}"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
testImplementation "org.mockito:mockito-core:5.11.0"
testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}"
testImplementation "io.helidon.config:helidon-config:${helidonVersion}"
testImplementation "io.helidon.microprofile.testing:helidon-microprofile-testing-junit5:${helidonVersion}"
testImplementation "io.helidon.microprofile.testing:helidon-microprofile-testing-mocking:${helidonVersion}"
}
jar {
archiveBaseName = "${rootProject.name}"
archiveVersion = "${project.version}"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.register('delombok') {
description 'Delomboks the source code'
ant.taskdef(classname: 'lombok.delombok.ant.Tasks$Delombok',
classpath: configurations.compileClasspath.asPath,
name: 'delombok')
ant.delombok(verbose: 'true',
encoding: 'UTF-8',
to: 'build/delombok',
from: 'src/')
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'Otto Config'
description = 'Configuration library for AWS AppConfig, Secrets Manager, and Parameter Store integration'
url = 'https://github.com/otto-de/otto-config'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'otto-de'
name = 'Otto GmbH & Co KG'
}
}
scm {
connection = 'scm:git:https://github.com/otto-de/otto-config.git'
developerConnection = 'scm:git:ssh://github.com/otto-de/otto-config.git'
url = 'https://github.com/otto-de/otto-config'
}
}
}
}
repositories {
maven {
name = 'GitHubPackages'
url = uri("https://maven.pkg.github.com/otto-de/otto-config")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: findProperty("gpr.user")
password = System.getenv("GITHUB_TOKEN") ?: findProperty("gpr.token")
}
}
maven {
name = 'MavenCentral'
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVENCENTRAL_USERNAME") ?: findProperty("mavenCentral.username")
password = System.getenv("MAVENCENTRAL_PASSWORD") ?: findProperty("mavenCentral.password")
}
}
maven {
name = 'staging'
// Publish to local staging directory for JReleaser to upload
url = layout.buildDirectory.dir('staging-deploy')
}
}
}
jreleaser {
release {
github {
update {
enabled = true
}
}
}
project {
snapshot {
fullChangelog = true
}
}
gitRootSearch = true
signing {
active = 'ALWAYS'
armored = true
verify = false // Don't require public key - JReleaser will extract it from secret key
publicKey = System.getenv('JRELEASER_GPG_PUBLIC_KEY') ?: ''
secretKey = System.getenv('JRELEASER_GPG_SECRET_KEY') ?: ''
passphrase = System.getenv('JRELEASER_GPG_PASSPHRASE') ?: ''
}
deploy {
maven {
github {
app {
snapshotSupported = true
active = System.getenv('JRELEASER_DEPLOY_MAVEN_GITHUB_ACTIVE') ?: 'ALWAYS'
url = "https://maven.pkg.github.com/otto-de/otto-config"
stagingRepository('build/staging-deploy')
}
}
mavenCentral {
app {
snapshotSupported = false
active = System.getenv('JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_ACTIVE') ?: 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('build/staging-deploy')
retryDelay = 10
maxRetries = 240
}
}
}
}
}
signing {
def signingKey = findProperty("signingKey") ?: System.getenv("GPG_SIGNING_KEY")
def signingPassword = findProperty("signingPassword") ?: System.getenv("GPG_SIGNING_PASSWORD")
if (signingKey && signingPassword) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
} else {
// JReleaser will handle signing if Gradle signing is not configured
logger.warn("Gradle signing not configured - JReleaser will handle signing")
}
}
subprojects {
apply plugin: 'java'
dependencies {
// Common dependencies can be declared here
}
}