Expand description
Gradle classpath resolver.
Extracts classpath JARs from Gradle projects by writing a temporary init script
and executing gradlew --init-script <script> sqryListClasspath. Parses the
structured output lines to build ResolvedClasspath entries per module.
§Strategy
- Write a temporary init script that adds a
sqryListClasspathtask to all projects. - Locate
gradlew(orgradlew.baton Windows) in the project root. - Execute the wrapper with the init script. Timeout defaults to 60 seconds.
- Parse
SQRY_CP:<module>:<group>:<name>:<version>:<path>lines. - On failure or timeout, fall back to a cached
resolved-classpath.json.
§Security
Only the project’s own Gradle wrapper is executed — never a system-wide gradle
binary. This prevents supply-chain attacks via a rogue global installation.
Functions§
- resolve_
gradle_ classpath - Resolve classpath for a Gradle project.