extractClasspath

open fun extractClasspath(projectDir: Path): List<Path>?(source)

Attempts to extract the project's compile classpath by invoking the build tool.

Detects the build tool from projectDir:

  • pom.xml present → Maven via mvnw dependency:build-classpath (or mvn)

  • build.gradle / build.gradle.kts / settings.gradle(.kts) present → Gradle via a temporary init script that registers a printClasspathForOpenRewrite task

Return

The list of JAR paths that make up the project's compile/test classpath, or null if the build tool could not be invoked, returned a non-zero exit code, or produced an empty result. A null return signals LstBuilder to fall through to DependencyResolutionStage.