Skip to content

Fix Gradle 9.4.0 variant resolution failure with gradle-consistent-versions#149

Closed
FinlayRJW wants to merge 3 commits intodevelopfrom
finlayw/fix-gradle9-variant-resolution
Closed

Fix Gradle 9.4.0 variant resolution failure with gradle-consistent-versions#149
FinlayRJW wants to merge 3 commits intodevelopfrom
finlayw/fix-gradle9-variant-resolution

Conversation

@FinlayRJW
Copy link
Contributor

@FinlayRJW FinlayRJW commented Mar 10, 2026

Before this PR

On Gradle 9.4.0 with gradle-consistent-versions, compileClasspath resolution fails:

Could not resolve root project :.
  > Value for variants of root project : has not been calculated yet.

GCV's configureEach calls conf.extendsFrom(rootConfiguration) on all configs. Since rootConfiguration has a ProjectDependency on root, this creates a self-referencing cycle in the variant model for our consumable config on the root project. Introduced by gradle/gradle#36245 which made extendsFrom lazy.

After this PR

Excludes our custom outgoing configuration from GCV's configureEach using VersionRecommendationsExtension.excludeConfigurations(). Our configurations use a custom Usage attribute with no external module dependencies, so GCV's version constraints are irrelevant.

Also bumps tested Gradle 9 version to 9.4.0 and adds a GCV compatibility test.

Superseded by #150 which fixes the architectural root cause instead.

Possible downsides?

Testing

  • New compatible_with_consistent_versions test
  • All existing tests pass

@changelog-app
Copy link

changelog-app bot commented Mar 10, 2026

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Fix Gradle 9.4.0 variant resolution failure with gradle-consistent-versions

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link

changelog-app bot commented Mar 10, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

💡 Improvements

  • Fix Gradle 9.4.0 variant resolution failure with gradle-consistent-versions (#149)

@FinlayRJW
Copy link
Contributor Author

closed in favour of palantir/gradle-consistent-versions#1614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant