Skip to content

Commit 06b48f9

Browse files
zeevmoneyclaude
andcommitted
Fix Gradle 8.x task dependency and duplicate artifact issues
- Add task dependency fix for plainJavadocJar -> generateMetadataFileForMavenPublication - Remove duplicate withSourcesJar/withJavadocJar (handled by vanniktech plugin) - Add -PskipSigning flag for local testing without GPG keys - Update PUBLISHING.md with skipSigning documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e7012f5 commit 06b48f9

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

PUBLISHING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ The workflow (`.github/workflows/publish.yaml`) handles:
6262
Test artifact generation without uploading:
6363

6464
```bash
65-
./gradlew publishToMavenLocal
65+
./gradlew publishToMavenLocal -PskipSigning
6666
```
6767

6868
Artifacts are published to `~/.m2/repository/io/permit/permit-sdk-java/`
6969

70+
Note: Use `-PskipSigning` for local testing without GPG keys. This flag is not available for Maven Central publishing (signing is required).
71+
7072
#### Publish to Maven Central (Staging Only)
7173

7274
Upload to Central Portal without releasing:

build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ java {
3737
toolchain {
3838
languageVersion = JavaLanguageVersion.of(8)
3939
}
40-
// sources are required by maven central in order to accept the package
41-
withSourcesJar()
42-
// javadoc jar is required by maven central in order to accept the package
43-
withJavadocJar()
40+
// Note: sources and javadoc JARs are created by the vanniktech maven-publish plugin
4441
}
4542

4643
// package dependencies
@@ -152,8 +149,11 @@ mavenPublishing {
152149
// Publish to Maven Central Portal (new system replacing OSSRH)
153150
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
154151

155-
// Sign all publications with GPG
156-
signAllPublications()
152+
// Sign all publications with GPG (required for Maven Central)
153+
// For local testing without GPG, use: ./gradlew publishToMavenLocal -PskipSigning
154+
if (!project.hasProperty('skipSigning')) {
155+
signAllPublications()
156+
}
157157

158158
// Artifact coordinates
159159
coordinates("io.permit", "permit-sdk-java", version.toString())
@@ -218,3 +218,9 @@ tasks.named('jar') {
218218
attributes('Implementation-Title': project.name, 'Implementation-Version': project.version)
219219
}
220220
}
221+
222+
// Fix Gradle 8.x task dependency validation issue with vanniktech plugin
223+
// The plainJavadocJar task must run before generateMetadataFileForMavenPublication
224+
tasks.withType(GenerateModuleMetadata).configureEach {
225+
dependsOn tasks.matching { it.name == 'plainJavadocJar' }
226+
}

0 commit comments

Comments
 (0)