antlers.toml Reference

Complete reference for the antlers.toml configuration file format.

Status

The CLI currently uses antlers.toml for init, add, show, and fmt. resolve and fetch are driven by CLI arguments and do not read the file yet. The schema below is intended for tooling and library integrations.

Overview

[project]
name = "my-project"
version = "1.0.0"
description = "My JVM project"

[[repositories]]
id = "central"
name = "Maven Central"
url = "https://repo1.maven.org/maven2/"
ecosystem = "maven"

[[repositories]]
id = "github"
name = "GitHub Packages"
url = "https://maven.pkg.github.com/org/repo"

[repositories.credentials]
type = "bearer"
token = { env = "GITHUB_TOKEN" }

[dependencies]
"com.google.guava:guava" = "33.0.0-jre"
"org.jetbrains.kotlin:kotlin-stdlib" = "2.0.0"

[dev-dependencies]
"org.junit.jupiter:junit-jupiter" = "5.10.0"

[build-dependencies]
"org.jetbrains.kotlin:kotlin-gradle-plugin" = "2.0.0"

[constraints]
"com.fasterxml.jackson:jackson-bom" = { version = "2.16.0", type = "bom" }

[exclusions]
"commons-logging:commons-logging" = "*"

[resolver]
conflict-strategy = "highest-wins"
transitive = true

[cache]
path = ".antlers/cache"
mode = "read-write"

[network]
offline = false
connect-timeout = 30
max-connections = 16

[env]
allow = ["GITHUB_TOKEN", "MAVEN_USER", "MAVEN_PASS"]

[output]
lockfile = "antlers.lock.json"
require-sha256 = true

[project]

Project metadata. Optional but recommended.

FieldTypeDescription
namestringProject name
versionstringProject version
descriptionstringProject description
[project]
name = "my-project"
version = "1.0.0"
description = "A sample JVM project"

[[repositories]]

Repository configuration. Order matters for priority.

FieldTypeRequiredDescription
idstringYesUnique identifier
urlstringYesRepository URL
namestringNoDisplay name
ecosystemstringNomaven, npm, pypi, nuget (default: maven)
credentialstableNoAuthentication configuration

Basic Repository

[[repositories]]
id = "central"
name = "Maven Central"
url = "https://repo1.maven.org/maven2/"
ecosystem = "maven"

With Bearer Token

[[repositories]]
id = "github"
url = "https://maven.pkg.github.com/org/repo"

[repositories.credentials]
type = "bearer"
token = { env = "GITHUB_TOKEN" }

With Basic Auth

[[repositories]]
id = "artifactory"
url = "https://artifactory.example.com/maven"

[repositories.credentials]
type = "basic"
username = { env = "ARTIFACTORY_USER" }
password = { env = "ARTIFACTORY_PASS" }
[repositories.credentials]
type = "basic"
username = "myuser"
password = "mypassword"  # Avoid committing secrets!

Netrc Authentication

[repositories.credentials]
type = "netrc"

[dependencies]

Dependencies to resolve. Keys are group:artifact coordinates.

Simple Version

[dependencies]
"com.google.guava:guava" = "33.0.0-jre"
"org.jetbrains.kotlin:kotlin-stdlib" = "2.0.0"

Detailed Specification

[dependencies]
"com.google.guava:guava" = { version = "33.0.0-jre", classifier = "jdk8" }
"org.apache.logging.log4j:log4j-core" = { version = "2.23.0", exclusions = ["org.apache.logging.log4j:log4j-api"] }

Detailed fields:

FieldTypeDescription
versionstringRequired version requirement
scopestringMaven scope (compile, runtime, test, provided)
classifierstringClassifier (e.g., sources, javadoc)
typestringArtifact type/extension (e.g., jar, pom)
exclusionsarrayTransitive exclusions (group:artifact)
transitiveboolWhether to include transitive deps (default: true)

[dev-dependencies]

Development-only dependencies. Same format as [dependencies].

[dev-dependencies]
"org.junit.jupiter:junit-jupiter" = "5.10.0"
"org.mockito:mockito-core" = "5.10.0"

[build-dependencies]

Build-time dependencies. Same format as [dependencies].

[build-dependencies]
"org.jetbrains.kotlin:kotlin-gradle-plugin" = "2.0.0"

[constraints]

Version constraints (BOMs, platform constraints). Keys are group:artifact.

[constraints]
"com.fasterxml.jackson:jackson-bom" = { version = "2.16.0", type = "bom" }
"org.springframework:spring-framework-bom" = { version = "6.1.5", type = "platform" }

Constraint fields:

FieldTypeDescription
versionstringRequired version
typestringbom or platform

[exclusions]

Global exclusions applied to all dependencies.

[exclusions]
"commons-logging:commons-logging" = "*"
"log4j:log4j" = "2.0.0"

[resolver]

Resolution behavior configuration.

FieldTypeDefaultDescription
conflict-strategystringhighest-winshighest-wins, nearest-wins, strict
transitivebooltrueResolve transitive dependencies
[resolver]
conflict-strategy = "highest-wins"
transitive = true

Conflict Strategies

  • highest-wins - Use highest version when conflicts occur (Gradle/Coursier-like)
  • nearest-wins - Use version from nearest dependency in tree (Maven-like)
  • strict - Fail on any version conflict

[cache]

Caching configuration.

FieldTypeDefaultDescription
pathstringOS defaultCache directory path
modestringread-writeread-write, read-only, disabled
[cache]
path = ".antlers/cache"
mode = "read-write"

[network]

Network behavior configuration.

FieldTypeDescription
offlineboolDisable network access
connect-timeoutintConnection timeout in seconds
max-connectionsintMaximum concurrent connections
[network]
offline = false
connect-timeout = 30
max-connections = 16

[env]

Environment variable configuration for hermetic workflows.

FieldTypeDescription
allowarrayEnvironment variables that can be used
[env]
allow = ["GITHUB_TOKEN", "MAVEN_USER", "MAVEN_PASS"]

[output]

Output configuration used by tooling/integrations.

FieldTypeDescription
lockfilestringLockfile path
require-sha256boolRequire SHA-256 checksums in outputs
[output]
lockfile = "antlers.lock.json"
require-sha256 = true