Skip to content

Commit 48d8114

Browse files
dili91claude
andcommitted
[ACL-296] Fix snapshot repo release 403 error by migrating to vanniktech maven publish plugin
- Replace nexus-publish-plugin with com.vanniktech.maven.publish plugin - Simplify publishing configuration and remove manual signing setup - Update gradle tasks to use new task registration syntax - Bump version to 17.3.1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 398daae commit 48d8114

2 files changed

Lines changed: 35 additions & 62 deletions

File tree

build.gradle

Lines changed: 31 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ plugins {
44
id "io.freefair.lombok" version "8.13.1"
55
// to make our tests output more fancy
66
id 'com.adarshr.test-logger' version '4.0.0'
7-
// to publish packages
8-
id 'maven-publish'
97
// code linting
108
id "com.diffplug.spotless" version "7.0.3"
119
// test coverage
1210
id 'jacoco'
1311
id 'com.github.kt3k.coveralls' version '2.12.2'
14-
// signing
15-
id "signing"
16-
// nexus publishing
17-
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
12+
// Maven central publishing
13+
id "com.vanniktech.maven.publish" version "0.34.0"
1814
}
1915

2016
compileJava {
@@ -28,7 +24,8 @@ spotless {
2824
}
2925
}
3026

31-
task createProperties(dependsOn: processResources) {
27+
tasks.register('createProperties') {
28+
dependsOn processResources
3229
doLast {
3330
file("${layout.buildDirectory.get()}/resources/main/truelayer-java.version.properties").withWriter { w ->
3431
Properties p = new Properties()
@@ -147,66 +144,43 @@ jacocoTestReport {
147144
}
148145
}
149146

150-
task sourcesJar(type: Jar) {
147+
tasks.register('sourcesJar', Jar) {
151148
from sourceSets.main.allJava
152149
archiveClassifier = 'sources'
153150
}
154151

155-
task javadocJar(type: Jar) {
152+
tasks.register('javadocJar', Jar) {
156153
from javadoc
157154
archiveClassifier = 'javadoc'
158155
}
159156

160-
publishing {
161-
publications {
162-
mavenJava(MavenPublication) {
163-
from(components.java)
164-
artifact sourcesJar
165-
artifact javadocJar
166-
167-
pom {
168-
name = project_name
169-
packaging = 'jar'
170-
description = project_description
171-
url = project_url
172-
scm {
173-
connection = project_scm
174-
developerConnection = project_scm
175-
url = project_url
176-
}
177-
licenses {
178-
license {
179-
name = project_license_name
180-
url = project_license_url
181-
}
182-
}
183-
developers {
184-
developer {
185-
id = project_developer
186-
name = project_developer
187-
}
188-
}
189-
}
190-
}
191-
}
192-
}
157+
mavenPublishing {
158+
publishToMavenCentral()
193159

194-
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
195-
signing {
196-
def signingKey = System.getenv('SONATYPE_GPG_KEY')
197-
def signingPassword = System.getenv('SONATYPE_GPG_PASSPHRASE')
198-
useInMemoryPgpKeys(signingKey, signingPassword)
199-
sign publishing.publications.mavenJava
200-
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
201-
}
160+
//signAllPublications()
202161

203-
nexusPublishing {
204-
repositories {
205-
sonatype {
206-
nexusUrl = uri(sonatype_repository_url)
207-
snapshotRepositoryUrl = uri(sonatype_snapshot_repository_url)
208-
username = System.getenv("SONATYPE_USERNAME")
209-
password = System.getenv("SONATYPE_PASSWORD")
162+
pom {
163+
name = project_name
164+
packaging = 'jar'
165+
description = project_description
166+
url = project_url
167+
scm {
168+
connection = project_scm
169+
url = project_url
170+
}
171+
licenses {
172+
license {
173+
name = project_license_name
174+
url = project_license_url
175+
distribution = project_license_url
176+
}
177+
}
178+
developers {
179+
developer {
180+
id = developer_name
181+
name = developer_name
182+
url = developer_url
183+
}
210184
}
211185
}
212186
}

gradle.properties

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Main properties
22
group=com.truelayer
33
archivesBaseName=truelayer-java
4-
version=17.3.0
4+
version=17.3.1
55

66
# Artifacts properties
7-
sonatype_repository_url=https://s01.oss.sonatype.org/service/local/
8-
sonatype_snapshot_repository_url=https://s01.oss.sonatype.org/content/repositories/snapshots/
97
project_name=TrueLayer Java
108
project_description=TrueLayer Java SDK for https://truelayer.com
119
project_url=https://github.com/TrueLayer/truelayer-java
10+
project_scm=scm:git:https://github.com/TrueLayer/truelayer-java.git
1211
project_license_url=https://raw.githubusercontent.com/TrueLayer/truelayer-java/main/LICENSE
1312
project_license_name=MIT License
14-
project_developer=truelayer
15-
project_scm=scm:git:https://github.com/TrueLayer/truelayer-java.git
13+
developer_name=truelayer
14+
developer_url=https://github.com/TrueLayer

0 commit comments

Comments
 (0)