Repository navigation
CM-76621: Fix Gradle dependency restore on Gradle 9 and remapped subprojects - #589
Merged
Merged
Conversation
…rojects Gradle 9 removed the -b (--build-file) option, so the default restore failed. Run `gradle -p <manifest dir> dependencies` instead: Gradle finds the root settings file and selects the project whose projectDir matches. With --gradle-all-sub-projects, the project path was guessed from the directory name, which missed remapped projectDirs and nested projects and skipped them silently. Map manifest directories to project paths using the "Project locations" section of `gradle projects` (Gradle 9.1+), anchored to the build root even when the scan root is a subproject. Older Gradle versions keep the directory-name fallback, which now also handles the root manifest. Skipped manifests are logged at debug level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omer-roth
commented
Nov 8, 2026
CM-76621 remove narration commetn
Drop comments that narrate Gradle version history and extract the build-root lookup into _find_build_root so the code reads on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omer-roth
enabled auto-merge (squash)
November 8, 2026 14:11
avishaiamiel
approved these changes
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
gradle dependencies -b <manifest>→gradle -p <manifest dir> dependencies. Gradle 9 removed-b, so restore failed on Gradle 9.-pstarts Gradle in the manifest directory. Gradle then finds the root settings file and selects the project whoseprojectDiris that directory, so remapped and nested projects work too.--gradle-all-sub-projects: before, the project path was guessed as':' + <dir name>. That missed projects with a remappedprojectDirand nested projects, and skipped them with no message. Manifest directories are now mapped to project paths using the "Project locations" section ofgradle projects(Gradle 9.1+). Paths in that section are relative to the build root, and the mapping works out the build root even when the scan root is a subproject directory.dependencies).Why
CM-76621: a customer on Gradle 9.8.1 got no SCA results. The third part of that ticket, missing JFrog credentials on the runner, is server-side and not in this PR.
Verification
-pdefault, remapped and nested projects, the root manifest, a manifest outside the build, relative paths, CRLF output, Windows separators (runs on win32 only), a subproject scan root, and the older-Gradle fallback. SCA suite: 368 passed, 1 skipped. Ruff check and format are clean.projectDir+ nested project):Reviewer notes
🤖 Generated with Claude Code