Skip to content

Maven dependencies

Install Maven dependencies with elide install, including for projects that have only a pom.xml, and configure annotation processors in an Elide project.

On this page

Elide resolves Maven dependencies declared in elide.pkl or a pom.xml.

elide install

Maven is the default ecosystem. Buckets, repositories, credentials and install options: Dependencies.

Projects with only a pom.xml

elide install -p .

Elide reads the POM’s direct dependencies, ${property} values and its own dependencyManagement. Parents and imported BOMs are not merged; a dependency versioned only by a parent is dropped.

POM scopeBucket
compilepackages
provided, systemcompileOnly
runtimeruntimeOnly
testtestPackages

To run Maven goals, use Native Maven.

Inspect dependency code

In an elide.pkl project, the experimental dependency code index records types, members, and references from resolved Maven JARs. Use elide index resolve to find a class’s defining artifact, or elide index references to inspect what a dependency class uses.

OpenRewrite uses that index to run Java recipes. Declare additional recipe modules under dependencies.maven.devPackages and preview source changes with --dry-run.

Annotation processors

dependencies {
  maven {
    packages { "org.mapstruct:mapstruct:1.6.3" }
    processors { "org.mapstruct:mapstruct-processor:1.6.3" }
  }
}
  • Processors run in elide build and elide javac, on main and test source sets.
  • A changed processor JAR recompiles.
  • Generated sources go to .dev/jvm/generated-sources/<set>/java and compile with the set.
  • Processors see Java sources only, never Kotlin declarations. Kotlin compiles before Java processing, so Kotlin code that uses generated types must get them from an upstream source set or project.
  • Project builds don’t run processors over Kotlin (KAPT), and KSP is unsupported.
  • -proc:none, -proc:only and -proc:full behave as in javac.

elide javac --capabilities reports what this Elide build supports:

{
  "version": 1,
  "javaAnnotationProcessing": true,
  "kotlinSymbolProcessing": false,
  "kotlinCompilerPlugins": false
}
FieldMeaning
javaAnnotationProcessingJava annotation processors run.
kotlinSymbolProcessingKSP processors run.
kotlinCompilerPluginsThird-party Kotlin compiler plugins run in the embedded compiler. Built-in plugins and a managed or custom toolchain are not affected.

Set ELIDE_TRACE_PROCESSORS=1 to print each processor class as it loads (Loading processor dependency: demo.HelloProcessor).

Was this page helpful?