Skip to main content
Endor Labs can automatically detect the toolchains your projects need from the manifest files in your repository. Auto detection works for Java, Python, Go, .NET (C#), Ruby, Swift, and JavaScript (Node.js, Yarn, pnpm, and Rush) projects. See the Toolchain support matrix for a complete list of supported toolchain versions for auto detection. Scans run by the Endor Labs SCM apps use auto detection by default.

How auto detection works

Endor Labs begins auto detection by scanning your project repository to locate manifest files and identify the languages used in your project. Based on the results, it runs language-specific detectors to extract version information. Each detector operates independently and follows a consistent process. It reviews the associated manifest or build configuration files to determine the toolchain version. If a file contains multiple version fields, the detector uses a fixed priority order to select the most appropriate one. After identifying a version, the detector sends the version details to the assigner. The assigner checks the Endor Labs toolchain support matrix to see whether Endor Labs supports the version for the host operating system and architecture. If it finds an exact match, it selects that version. If it doesn’t, it selects the newest supported version with the same major version number. For Go, Endor Labs matches the minor version, so go 1.21 installs the newest supported 1.21 release. Node.js follows different rules, described in Node.js version selection. For example, when analyzing Java projects, the Java detector checks config files like pom.xml or build.gradle to find the Java version used in the project.

Config files scanned for version detection

The following table lists the config files Endor Labs scans to detect the toolchain versions your project uses. JavaScript projects can use Yarn, pnpm, or Rush as the build tool. The following examples show how to define versions in each config file.
Define the Java version in pom.xml. If pom.xml sets more than one Java version field, Endor Labs uses the first one it finds in the following order:
  1. maven.compiler.source
  2. source in maven-compiler-plugin
  3. release in maven-compiler-plugin
  4. maven.compiler.release
  5. java.version
Endor Labs reads the Maven version from distributionUrl in .mvn/wrapper/maven-wrapper.properties. Without a wrapper, pom.xml selects the Maven family. A modelVersion of 4.1.0 or a root="true" attribute on <project> selects Maven 4, and 4.0.0 selects Maven 3. Endor Labs doesn’t provide a Maven 4 toolchain yet, so a Maven 4 project builds with the Maven on the scan machine’s PATH. Maven 4 requires Java 17 or later.
Define the Java version using sourceCompatibility or targetCompatibility in build.gradle or build.gradle.kts. In build.gradle, quote the version value, such as '17'. Endor Labs also detects the version in a Java toolchain block, such as JavaLanguageVersion.of(17).Endor Labs reads the Gradle version from the -bin.zip distribution in gradle/wrapper/gradle-wrapper.properties. Endor Labs doesn’t detect -all.zip distributions.
Specify the Python version in any of the following config files.
Use python_requires inside the setup() block.
Specify the Node.js version in any of the following config files. See Node.js version selection to learn which release Endor Labs installs.
Use engines.node or volta.node.
This range installs 22.23.4, the newest supported release in the lowest major version the range allows.
Specify the Yarn version in any of the following config files. Endor Labs also infers the Yarn major version from the format of yarn.lock.
Use engines.yarn, packageManager, or volta.yarn. If the file sets more than one, Endor Labs uses them in that order.
Specify the pnpm version in package.json using engines.pnpm, packageManager, or volta.pnpm. If the file sets more than one, Endor Labs uses them in that order. Endor Labs also infers a pnpm version range from lockfileVersion in pnpm-lock.yaml.
Specify the .NET version using any of the following config files.
Use sdk.version.
Specify the Go version in go.mod with the go directive.
Specify the Ruby version in any of the following config files.
Use the ruby directive.
Specify the Swift version in any of the following config files.
Use the swift-tools-version comment in the first lines of the file.
Auto detection is best-effort and works only if your project’s config files are correctly configured.

Node.js version selection

Endor Labs installs the newest supported release in the major version that your config files request, even when they name an exact version. For example, a request for 24.8.0 installs 24.22.1. When a range allows more than one major version, Endor Labs uses the lowest supported major version in the range. When Endor Labs detects a request for Node.js 25, it usually installs the newest supported Node.js 26 release. A detected request for Node.js 20 or earlier, or for any other unsupported major version, installs the default Node.js version. Endor Labs still uses the detected Yarn and pnpm versions when they’re supported. macOS AMD64 has no default toolchain versions. See Node.js version selection for scan profiles to learn how Endor Labs handles a pinned version.

Enable auto detection for endorctl scans

To enable auto detection for endorctl scans, run the following command.
Enabling these options downloads the necessary build toolchains during each scan. This works well for one-time scans but may cause scan failures in CI environments due to intermittent network issues.