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, sogo 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.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
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
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.
- Package.swift
- .swift-version
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 for24.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.