Skip to content

Dependencies

Declare Maven, npm and PyPI dependencies in elide.pkl and install Maven and npm packages with elide install: ecosystems, options and installed files.

On this page

Declare dependencies in elide.pkl and install them with elide install.

EcosystemEnable withRead from
Mavendefaultelide.pkl, or a pom.xml project selected with -p
npm--ecosystems=npmelide.pkl and package.json
PyPI—dependencies.pypi is accepted; elide install does not install it

Install dependencies

Terminal
bash
elide install                         # Maven
elide install --ecosystems=npm        # npm
elide install --ecosystems=maven,npm  # both
elide install --workspace             # every ecosystem the project declares
Installing Maven and npm dependencies explicitly with Elide
 ~/demo  elide install --ecosystems=npm,maven
[722ms] ✓ NPM packages installed (541ms)
[18.1s] ✓ Resolved 17 Maven dependencies (17.4s)
[18.1s] ✓ Dependencies installed in 18.0s
 ~/demo  elide install --ecosystems=npm,maven
[ 11ms] Already up to date
[ 17ms] ⇥ Dependencies ready (Up to date)
[ 22ms] ✓ Dependencies installed in 13ms
 


A package.json does not turn on npm; name every ecosystem CI needs. An unknown or unavailable ecosystem is a usage error.

Declare dependencies

pkl
amends "elide:project.pkl"

dependencies {
  maven {
    packages {
      "com.google.guava:guava:33.4.8-jre"
    }
  }
  npm {
    packages { "react@19.0.0" }
    devPackages { "typescript@5.6.2" }
  }
  pypi {
    packages { "requests>=2" }
    optionalPackages { ["dev"] { "pytest>=8" } }
  }
}
utf-8 · pkl · Lines: 17

For a project with only a pom.xml, run elide install -p .; see Maven Dependencies.

Maven buckets

An entry is group:artifact:version[:classifier], a MavenPackageSpec, a local JAR path, or a project("name") reference. Workspace members can omit the version and take the root’s (Workspaces). Conflicts resolve nearest-first, as in Maven, unless overridden by resolutions.

BucketApplies to
packagesCompile and runtime classpaths of production sets.
devPackagesDevelopment time only.
modules--module-path for compiles, runs, tests and native images.
compileOnlyCompile classpath only.
runtimeOnlyRuntime classpath only.
processorsAnnotation-processor path; see Maven Dependencies.
testPackagesTest sets, in addition to their production set’s dependencies.
kotlinPluginsKotlin compiler plugins; see Kotlin Compiler.
exclusionsRemoved from resolution and every classpath.
substitutionsLocal files replacing a coordinate on every classpath; see reference.

Maven version resolutions

Use resolutions to select an exact version wherever a module appears in the dependency graph:

pkl
dependencies {
  maven {
    resolutions {
      ["org.example:library"] = "1.2.3"
    }
  }
}
utf-8 · pkl · Lines: 7

Keys are group:artifact; the override applies to direct and transitive requests, including all classifiers and packaging types, before their POMs are fetched. It does not add a dependency or restore an excluded dependency. Version ranges, wildcards, LATEST and RELEASE are rejected. Workspace members inherit root resolutions and can override them by key. Changing or removing a resolution causes the dependency graph to be resolved again.

Spring Boot starters:

pkl
dependencies {
  spring {
    version = "4.0.0"
    starter { "web"; "actuator" }
    testStarter { "test" }
  }
}
utf-8 · pkl · Lines: 7

Each name becomes org.springframework.boot:spring-boot-starter-<name>:<version> in packages or testPackages. Other Spring artifacts (spring-boot-devtools, org.springframework:*) go in maven; the two merge. The Spring Boot guide shows a complete manifest for building, testing and packaging an application with Elide.

Repositories

pkl
dependencies {
  maven {
    repositories {
      ["company"] = "https://maven.example.com/releases"
      ["private"] {
        url = "https://packages.example.com/maven"
        credentials {
          username = read("env:MAVEN_USER")
          password = read("env:MAVEN_TOKEN")
        }
      }
    }
    localRepository = ".m2/repository"
  }
}
utf-8 · pkl · Lines: 15
PropertyMeaning
repositories[name].urlRepository URL.
repositories[name].credentials.username, .passwordBasic authentication.
repositories[name].credentials.ntlmDomain, .ntlmWorkstationEither one selects NTLM.
repositories[name].name, .descriptionDisplay name and description.
enableDefaultRepositoriesInclude Maven Central (default true).
localRepositoryLocal Maven repository to resolve into.
  • Plain http:// to anything but 127.0.0.0/8 fails with Maven repository 'name' uses plain HTTP. elide build deps --allow-http-repositories accepts it.
  • read("env:…") needs --allow-env; see Build Flags.
  • With enableDefaultRepositories, Maven artifacts come from the maven.pkg.st proxy first, then Maven Central. elide build deps --use-pkgst=false (or --no-use-pkgst) uses Maven Central only; the global --pkgst and --no-pkgst flags do not change this.

Maven options

OptionEffect
--slimSkip sources and Javadoc.
--with=sourcesAlso fetch sources; javadoc and docs work too. Unknown values exit 2.
--directCopy artifacts into the project instead of linking.
--freshDownload every dependency again, refreshing the global cache.

elide build deps runs the same resolution as a task and also takes --offline, --allow-http-repositories and --use-pkgst.

Installed files

PathContents
.dev/dependencies/npm/node_modulesnpm packages; node_modules at the project root links here.
aube-lock.yamlnpm lockfile.
.dev/dependencies/m2Links into the standard Maven cache.
.dev/dependencies/m2/{compile,runtime,test,processors}.classpathResolved classpaths; see elide classpath.

In a workspace, links are in the root’s .dev/dependencies/; classpath files stay per project. There is no cross-ecosystem lockfile; see Build state.

Query dependency code

The experimental dependency code index records types, members, and references from resolved Maven JARs. Build it with elide index build --layers=l1,l2,l3, then use resolve to find which artifact defines a class, get to inspect a type or member, and references to follow its code references. used-by finds matching compiled local sources.

OpenRewrite uses the same index for Java source transformations. Add recipe modules to devPackages; they are development tools, separate from application dependencies.

Implicit JVM libraries

  • Java-only roots get no implicit Kotlin libraries, Metro runtime or Elide annotation API, even with a kotlin block.
  • Kotlin roots get the libraries their kotlin.features enable.
  • Kotlin roots also get the atomicfu runtime unless kotlin.features.atomicfu = false.
  • Test sets get bundled JUnit unless jvm.features.testing = false; elide test then needs your own junit-platform-console for JVM tests.
  • dev.elide:elide-api and elide-insight accept latest as a version and resolve to the bundled artifact.
  • Bundled libraries link Elide’s own JARs, but their sources and Javadoc come from your repositories like any other dependency’s, so --with=sources attaches kotlin-stdlib sources too. elide-api and elide-insight have none.

The full list, with versions: JVM APIs. To use Elide annotations from Java:

pkl
dependencies {
  maven {
    compileOnly { "dev.elide:elide-api:1.0.0" }
  }
}
utf-8 · pkl · Lines: 5

npm specifics: NPM Installer.

Studio session defaults also apply to the embedded npm installer: ELIDE_PKGST=1 enables the package CDN unless explicitly overridden by CLI flags. Requests to the HTTPS npm.pkg.st origin carry a valid ELIDE_STUDIO_SESSION_ID for internal correlation. Other registries receive no Studio session header. The native installer retains unchanged package content when dependency versions drift; Elide’s .dev/dependencies/npm layout does not require an exact whole-project input match to reuse those packages.

Was this page helpful?