Skip to content

chore: fix deprecated Gradle APIs, move to com.gradleup.shadow - #17

Draft
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1785143056-gradle-mainclass
Draft

chore: fix deprecated Gradle APIs, move to com.gradleup.shadow#17
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1785143056-gradle-mainclass

Conversation

@devin-ai-integration

@devin-ai-integrationdevin-ai-integrationBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes all Gradle deprecation warnings from this example ("Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0") and moves off the unmaintained com.github.johnrengelman.shadow plugin.

- id 'com.github.johnrengelman.shadow' version "6.0.0"+ id 'com.gradleup.shadow' version "8.3.11"-group 'com.launchdarkly'-version '1.0-SNAPSHOT'+group = 'com.launchdarkly'+version = '1.0-SNAPSHOT'- maven { url "https://oss.sonatype.org/content/groups/public/" }+ maven { url = "https://oss.sonatype.org/content/groups/public/" }
application {
- mainClassName = "Main"+ mainClass = "Main"
}
-distributionUrl=...gradle-7.5.1-bin.zip+distributionUrl=...gradle-8.14.3-bin.zip

Why each piece is required rather than cosmetic:

  • mainClassNamemainClass: JavaApplication.setMainClassName / JavaExec.main were deprecated and removed in Gradle 8.
  • shadow plugin: shadow 6.0.0 reads the deprecated project.mainClassName convention, so switching to mainClass alone makes ./gradlew assemble fail with property 'mainClassName' doesn't have a configured value. The plugin was renamed to com.gradleup.shadow, which requires Gradle 8.x — hence the wrapper bump.
  • space-assignment (group 'x', version 'x', maven { url "…" }) is deprecated as of Gradle 8.14 and scheduled for removal in Gradle 10.

Staying on shadow 8.3.x rather than 9.x: shadow 9 calls AdhocComponentWithVariants.addVariantsFromConfiguration(Provider, Action), which only exists in Gradle 9, and Gradle 9 requires Java 17+ to run — that would contradict the README's documented "Java 11 or higher".

No LaunchDarkly SDK version change: all dependency constraints are open ranges within the current major with no committed lockfile, so they already resolve to the latest compatible releases — launchdarkly-openfeature-serverprovider → 1.1.3, launchdarkly-java-server-sdk → 7.15.0, dev.openfeature:sdk → 1.22.0. No deprecated LaunchDarkly/OpenFeature APIs in Main.java (javac -Xlint:deprecation is clean).

Verification

Run locally against a real server-side SDK key, on Java 17:

  • ./gradlew clean assemble run --warning-mode all — zero deprecation warnings; prints SDK successfully initialized! / The sample-feature feature flag evaluates to false.
  • java -jar build/libs/hello-openfeature-java-server-1.0-SNAPSHOT-all.jar (the exact command CI runs) — same successful output, exit 0. The shadow jar filename is unchanged.

Link to Devin session: https://app.devin.ai/sessions/163c5cf635184c5ebdbc345afa517958
Requested by: @jsonbailey

…w plugin
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
ContributorAuthor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion

Copy link
Copy Markdown
Member

Devin, should we be using the newer version of this that has been renamed com.gradleup.shadow?

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
ContributorAuthor

Devin, should we be using the newer version of this that has been renamed com.gradleup.shadow?

Good call — switched to com.gradleup.shadow 8.3.11 in 1c660a5. That plugin requires Gradle 8.x, so I also bumped the wrapper 7.5.1 → 8.14.3 (and fixed the now-deprecated maven { url "..." } space-assignment syntax while there).

I stayed on the 8.3.x line rather than 9.x: shadow 9.x calls AdhocComponentWithVariants.addVariantsFromConfiguration(Provider, Action), which only exists in Gradle 9, and Gradle 9 requires Java 17+ to run — that would contradict the README's "Java 11 or higher". Happy to go to Gradle 9 + shadow 9.6.0 and raise the documented minimum to 17 if you'd prefer.

Verified locally with a real SDK key: ./gradlew run --warning-mode all and ./gradlew assemble + java -jar build/libs/hello-openfeature-java-server-1.0-SNAPSHOT-all.jar both succeed with zero deprecation warnings and print The sample-feature feature flag evaluates to false. The shadow jar name is unchanged, so CI's command still works.

@devin-ai-integrationdevin-ai-integrationBot changed the title chore: fix deprecated Gradle mainClassName usagechore: fix deprecated Gradle APIs, move to com.gradleup.shadowJul 28, 2026
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kinyoklion