fix(java): apply sonatype-central-upload plugin conditionally on JVM 11+#16656
fix(java): apply sonatype-central-upload plugin conditionally on JVM 11+#16656devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| # runtime. Seed CI compiles generated SDKs with a Java 8 JVM, so Gradle cannot | ||
| # resolve the plugin classpath and the project fails to configure. | ||
| - exhaustive:publish-to |
There was a problem hiding this comment.
🟡 exhaustive:publish-to not removed from allowedFailures despite receiving the same JVM 11 guard fix
The PR applies identical JVM 11 guards to both the exhaustive:publish-to and exhaustive:signed_publish fixtures (confirmed by the git diff updating both seed/java-sdk/exhaustive/publish-to/build.gradle and seed/java-sdk/exhaustive/signed_publish/build.gradle with the same buildscript classpath guard, conditional apply plugin, and guarded sonatypeCentralUpload blocks). However, only exhaustive:signed_publish was removed from allowedFailures at seed/java-sdk/seed.yml:393. The exhaustive:publish-to fixture remains listed as an allowed failure with a comment (seed/java-sdk/seed.yml:389-392) that is now inaccurate — the sonatype plugin is no longer unconditionally applied. This means CI silently skips test validation for the publish-to configuration path, so regressions won't be caught.
(Refers to lines 389-393)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Good catch — the same JVM 11 guard does fix exhaustive:publish-to too. Leaving it in allowedFailures here is intentional: this PR was scoped to remove only the exhaustive:signed_publish entry. The seed test treats a now-passing allowed-failure as a non-fatal "succeeded unexpectedly" warning (not a CI failure), so publish-to is still being run and validated — it just isn't being asserted as required yet. Happy to remove exhaustive:publish-to and update the stale comment in a follow-up (or here, if preferred).
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Description
The generated signed-publish
build.gradleapplied thecl.franciscosolis.sonatype-central-uploadplugin unconditionally. That plugin's published Gradle module metadata declares anorg.gradle.jvm.version = 11constraint, so on a Java 8 JVM Gradle fails dependency resolution of the plugin classpath — the project cannot even configure, so./gradlew compileJavafails. Seed CI compiles generated SDKs with a Java 8 JVM, which is whyexhaustive:signed_publish(andexhaustive:publish-to) were inallowedFailures.The fix gates the plugin behind a JVM-version check so the generated project configures/compiles on older JVMs while preserving publish behavior on JVM 11+ (the generated
ci.ymlalready runs compile/test/publish on Java 11). Since the plugin literally cannot run on Java 8, gating it changes no real publish scenario.This removes
exhaustive:signed_publishfromallowedFailures.exhaustive:publish-tois left inallowedFailuresper scope, though its regenerated output is also fixed by the same change.Changes Made
GeneratedBuildGradle: when signing/publishing, emit a leadingbuildscript {}block that adds the upload plugin to the build classpath only on JVM 11+, then apply it and configure thesonatypeCentralUpload {}extension andsonatypeCentralUpload.dependsOn buildinsideif (JavaVersion.current().isJava11Compatible()) { ... }guards. The coresigning {}block stays unconditional (built-in, Java 8 compatible).AbstractGeneratorCli: stop addingcl.franciscosolis.sonatype-central-uploadto the declarativeplugins {}block (it now lives in the JVM-gatedbuildscriptclasspath).seed/java-sdk/exhaustive/signed_publish/build.gradleand.../publish-to/build.gradle.exhaustive:signed_publishfromseed/java-sdk/seed.ymlallowedFailures.Generated shape (signed publish):
Testing
./gradlew compileJavaon the generatedsigned_publishproject with Java 8 failed withDependency requires at least JVM runtime version 11. This build uses a Java 8 JVM../gradlew compileJava spotlessChecksucceeds on Java 8 for bothsigned_publishandpublish-to.sonatypeCentralUploadtask is still registered (typeSonatypeCentralUploadTask) andsonatypeCentralUpload.dependsOn buildconfigures cleanly — publish path intact.pnpm run check(biome) andgenerators/javaspotlessCheckboth pass.Link to Devin session: https://app.devin.ai/sessions/efe7d1c705d0485a910f7b8e03bad737
Requested by: @iamnamananand996