Skip to content

Upgrade to Gradle 8.11.1 to fix PGP verification issues - #599

Merged
fdevans merged 6 commits into
mainfrom
upgrade-gradle-8
Jan 26, 2026
Merged

Upgrade to Gradle 8.11.1 to fix PGP verification issues#599
fdevans merged 6 commits into
mainfrom
upgrade-gradle-8

Conversation

@fdevans

@fdevans fdevans commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Upgrade to Gradle 8.11.1 to Fix PGP Verification Issues

Problem

Multiple Renovate PRs have been failing with this error:

class org.bouncycastle.openpgp.PGPCompressedData cannot be cast to class org.bouncycastle.openpgp.PGPSignatureList

This is a known bug in Gradle 7.x's BouncyCastle PGP processing when handling certain PGP key formats (specifically compressed signature packets). Every time Renovate updates a dependency, new PGP keys need to be downloaded, triggering this bug and causing CI to fail.

Solution

Upgraded to Gradle 8.11.1, which includes a fixed version of BouncyCastle that properly handles PGP signatures.

Changes

Gradle & Plugins

  • Gradle: 7.6.6 → 8.11.1
  • Shadow plugin: 7.1.2 → 8.1.1 (Gradle 8 compatibility)
  • OSPackage plugin: 9.1.1 → 11.11.2 (includes namespace change from nebula.ospackage to com.netflix.nebula.ospackage)

Verification Files

  • Completely regenerated gradle/verification-keyring.keys with fresh PGP keys (no more corrupted signatures)
  • Regenerated gradle/verification-metadata.xml with both PGP and SHA256 verification
  • Removed obsolete .gpg file per documentation

Renovate Configuration

Added postUpgradeTasks to automatically regenerate verification metadata when dependencies are updated:

{
  "postUpgradeTasks": {
    "commands": [
      "./gradlew --write-verification-metadata sha256 help"
    ],
    "fileFilters": [
      "gradle/verification-metadata.xml"
    ]
  }
}

This ensures future Renovate PRs automatically include updated checksums for new dependency versions.

Benefits

Fixes PGP verification bug - No more ClassCastException errors
Enables strict dependency verification - Full PGP + SHA256 validation works reliably
Better build performance - Gradle 8 includes performance improvements and configuration caching
Renovate automation - Dependency updates will now work seamlessly
Future-proof - Gradle 8 is actively maintained and supports Java 11-21

Testing

  • ✅ Clean build successful with strict verification: ./gradlew clean build --dependency-verification strict
  • ✅ All 75 tasks execute without errors
  • ✅ Compatible with existing Java 11 build environment
  • ✅ No breaking changes to build scripts or configuration

Compatibility

  • Java: Still builds with Java 11 (CI unchanged)
  • Plugins: All plugins updated to Gradle 8 compatible versions
  • APIs: No deprecated API usage that would break with Gradle 9
  • CI/CD: No workflow changes needed - wrapper handles version automatically

Post-Merge Actions

After this merges to main:

  1. Rebase existing Renovate PRs - They will now pass CI
  2. Future Renovate PRs - Will automatically work with auto-updated verification metadata
  3. Manual dependency updates - Use ./gradlew --write-verification-metadata sha256 help to update checksums

References

Upgrades:
- Gradle 7.6.6 → 8.11.1
- Shadow plugin 7.1.2 → 8.1.1
- OSPackage plugin 9.1.1 → 11.11.2 (with namespace change to com.netflix)

Benefits:
- Fixes PGP signature verification ClassCastException bug in Gradle 7.x
- Enables reliable dependency verification with PGP + SHA256
- Improves build performance and configuration caching
- Allows Renovate to auto-update verification metadata via postUpgradeTasks

Testing:
- Clean build passes with strict verification
- All plugins compatible
- No breaking changes to build configuration

Regenerated verification-metadata.xml and verification-keyring.keys with
PGP and SHA256 verification enabled. Gradle 8 handles PGP signatures
correctly, eliminating the need for workarounds.

Configured Renovate to automatically regenerate SHA256 checksums when
updating dependencies via postUpgradeTasks.
- Add trusted keys for javax.activation, javax.xml.bind, net.java, com.squareup.okio
- Update Renovate postUpgradeTasks to regenerate PGP trust entries (pgp,sha256)
- This ensures Renovate automatically updates both checksums and trusted keys

Previously Renovate was only updating sha256 checksums, which meant new
dependencies with PGP signatures would fail verification in CI.
- Add trusted keys for javax.activation, javax.xml.bind, net.java, com.squareup.okio
- Regenerate verification keyring to include all missing PGP keys
- Update Renovate postUpgradeTasks to regenerate both metadata and keyring (--export-keys)
- Add gradle/verification-keyring.keys to Renovate fileFilters

This ensures Renovate automatically updates both the verification metadata XML
(trusted key list) and the keyring file (actual PGP keys) when updating
dependencies. Previously only the XML was being updated, causing CI failures
when new dependencies introduced new signing keys.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the project from Gradle 7.6.6 to Gradle 8.11.1 to fix PGP verification issues caused by a known bug in Gradle 7.x's BouncyCastle PGP processing. The upgrade ensures reliable dependency verification and enables automated Renovate updates.

Changes:

  • Upgraded Gradle from 7.6.6 to 8.11.1
  • Updated shadow plugin from 7.1.2 to 8.1.1 (Gradle 8 compatibility)
  • Updated OSPackage plugin from 9.1.1 to 11.11.2 with namespace change from nebula.ospackage to com.netflix.nebula.ospackage
  • Regenerated dependency verification files with updated PGP keys and SHA256 checksums
  • Added Renovate postUpgradeTasks to automatically update verification metadata
  • Updated README documentation with clearer instructions for manual dependency updates

Reviewed changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
renovate.json Added postUpgradeTasks to automate verification metadata updates when Renovate updates dependencies
gradle/wrapper/gradle-wrapper.properties Updated Gradle distribution URL from 7.6.6 to 8.11.1
gradle/verification-metadata.xml Regenerated with schema 1.3, updated trusted keys, and fresh PGP/SHA256 verification data
gradle/libs.versions.toml Updated plugin versions and OSPackage plugin namespace
README.md Improved documentation with clearer instructions for dependency verification updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove verification-keyring.gpg from tracking (binary format not needed)
- Clarify README instructions for manual dependency updates
- Only verification-keyring.keys (text format) is needed for verification
Comment thread README.md Outdated
@fdevans
fdevans merged commit ef72e3a into main Jan 26, 2026
15 checks passed
@fdevans
fdevans deleted the upgrade-gradle-8 branch January 26, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants