Skip to content

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

Merged
kinyoklion merged 4 commits into
mainfrom
devin/1785143056-gradle-mainclass
Aug 31, 2026
Merged

chore: fix deprecated Gradle APIs, move to com.gradleup.shadow, bump build deps#17
kinyoklion merged 4 commits into
mainfrom
devin/1785143056-gradle-mainclass

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot 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


Note

Overview
Modernizes the example’s Gradle build so it runs cleanly on Gradle 8 without deprecation warnings and stays compatible with the maintained Shadow fat-jar plugin.

The wrapper moves from Gradle 7.5.1 to 8.14.5, and the Shadow plugin switches from com.github.johnrengelman.shadow 6.0.0 to com.gradleup.shadow 8.3.11 (required for Gradle 8 and mainClass instead of the removed mainClassName). build.gradle also adopts Gradle 8+ syntax for group, version, and the Sonatype maven URL, and sets application.mainClass instead of mainClassName. Test dependencies bump JUnit Jupiter from 5.8.1 to 5.14.4. Application/SDK dependency ranges and CI’s assemble / -all.jar flow are unchanged.

Reviewed by Cursor Bugbot for commit 945cd04. Bugbot is set up for automated code reviews on this repo. Configure here.

…w plugin

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

Copy link
Copy Markdown
Contributor Author

🤖 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
Contributor Author

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-integration devin-ai-integration Bot changed the title chore: fix deprecated Gradle mainClassName usage chore: fix deprecated Gradle APIs, move to com.gradleup.shadow Jul 28, 2026
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
@kinyoklion
kinyoklion marked this pull request as ready for review August 10, 2026 22:33
@kinyoklion
kinyoklion requested a review from a team as a code owner August 10, 2026 22:33
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title chore: fix deprecated Gradle APIs, move to com.gradleup.shadow chore: fix deprecated Gradle APIs, move to com.gradleup.shadow, bump build deps Aug 31, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@cursor review

@kinyoklion
kinyoklion merged commit f05c6b0 into main Aug 31, 2026
4 checks passed
@kinyoklion
kinyoklion deleted the devin/1785143056-gradle-mainclass branch August 31, 2026 23:01
Sign up for free to 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.

2 participants