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. Auto detection skips every path undernode_modules relative to the scan root, even when you set --include-path. Committed manifests inside node_modules don’t affect the detected Node.js, Yarn, or pnpm version. Based on the results, Endor Labs 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 and Swift follow different rules, described in Node.js version selection and Swift 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.Java with Maven
Java with Maven
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:maven.compiler.sourcesourceinmaven-compiler-pluginreleaseinmaven-compiler-pluginmaven.compiler.releasejava.version
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.- Version property
- Compiler plugin
- maven-wrapper.properties
Java with Gradle
Java with Gradle
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.- build.gradle
- build.gradle.kts
- gradle-wrapper.properties
Python
Python
Specify the Python version in any of the following config files.
- setup.py
- pyproject.toml
- .python-version
Use
python_requires inside the setup() block.Node.js
Node.js
Specify the Node.js version in any of the following config files. See Node.js version selection to learn which release Endor Labs installs.
- package.json
- .nvmrc
- .node-version
Use This range installs
engines.node or volta.node.22.23.4, the newest supported release in the lowest major version the range allows.Yarn
Yarn
Specify the Yarn version in any of the following config files. Endor Labs also infers the Yarn major version from the format of If multiple configuration files specify a Yarn version, Endor Labs uses the version from the file with the fewest directory levels below the scan root. If multiple files are at the same level, Endor Labs selects the first file alphabetically by path name.To use a different Yarn version, set the version in the toolchains of a scan profile. See Configure toolchains to learn more.
yarn.lock.- package.json
- .yarnrc.yml
- .yarnrc
Use
engines.yarn, packageManager, or volta.yarn. If the file sets more than one, Endor Labs uses them in that order.pnpm
pnpm
Specify the pnpm version in If multiple configuration files specify a pnpm version, Endor Labs uses the version from the file with the fewest directory levels below the scan root. If multiple files are at the same level, Endor Labs selects the first file alphabetically by path name.To use a different pnpm version, set the version in the toolchains of a scan profile. See Configure toolchains to learn more.
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..NET
.NET
Specify the .NET version using any of the following config files.
- global.json
- *.csproj
- Directory.Build.props
- Directory.Packages.props
Use
sdk.version.Go
Go
Specify the Go version in
go.mod with the go directive.Ruby
Ruby
Specify the Ruby version in any of the following config files.
- Gemfile
- .ruby-version
- .rvmrc
Use the
ruby directive.Swift
Swift
Specify the Swift version in any of the following config files. See Swift version selection to learn which release Endor Labs installs.
- Package.swift
- .swift-version
Use the
swift-tools-version comment in the first lines of the file.Auto detection can miss toolchain versions if your project’s config files use non-standard syntax or aren’t configured as shown above.
Node.js version selection
When more than one config file requests a Node.js version, Endor Labs uses the file closest to the root of the scan. That is the file with the fewest directory levels in its path. Among files at the same level, Endor Labs uses the first by name, so a root.nvmrc takes precedence over a root package.json. Endor Labs skips a file whose request would fall back to the default Node.js version and uses the next closest file instead.
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 when no other config file requests a supported 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.
Swift version selection
Auto detection supports Swift releases from5.7.0 through 6.3.3, including .swift-version pins to 6.3.1, 6.3.2, and 6.3.3. Endor Labs resolves a two-segment major.minor version in Package.swift or .swift-version to the newest supported patch release in that minor line. For example, Endor Labs installs 6.3.3 when your project specifies 6.3.
When your repository specifies multiple supported versions, Endor Labs uses the highest version as the main toolchain. It also installs any other supported versions set in .swift-version files. Endor Labs installs 6.3.3 when your project specifies a version above 6.3.3 or no supported Swift version.