# MavenImport()

Parses a pom.xml and resolves each declared `<dependency>` into Lucee's local maven cache, fetching any that are not already present.

By default only the literal dependencies listed in the pom are resolved — pairs symmetrically with [MavenExport()](mavenexport.md), which writes the full cache contents as a flat list. 

Pass `includeTransitive=true` to also walk the dependency tree for each entry (same behaviour as [MavenLoad()](mavenload.md)).

Returns a query with the same shape as [MavenInfo()](maveninfo.md), showing what was resolved.

**Introduced:** 7.1.0.98

```
MavenImport( pomPath=string, includeTransitive=boolean );
```

**Returns:** query

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| pomPath | string | Yes | Filesystem path to a pom.xml file to import. |  |
| includeTransitive | boolean | No | If false (default), only the literal `<dependency>` entries in the pom are resolved. If true, the full transitive dependency tree is resolved for each entry. | false |

# Examples

Rehydrate a cache from a committed pom:

```cfml
q = mavenImport( "/app/pom.xml" );
systemOutput( "Resolved " & q.recordcount & " dependencies", true );
```

Literal mode (default) — only the coords listed in the pom, no transitive walk — round-trips exactly against [MavenExport()](mavenexport.md):

```cfml
fileWrite( "/tmp/pom.xml", mavenExport() );
// ... elsewhere, fresh install ...
mavenImport( "/tmp/pom.xml" );
```

Transitive mode — resolve each entry's full dependency tree, same as [MavenLoad()](mavenload.md):

```cfml
q = mavenImport( "/app/top-level-deps.xml", includeTransitive=true );
```

Inspect what was resolved:

```cfml
q = mavenImport( "/app/pom.xml" );
loop query=q {
    systemOutput( q.groupId & ":" & q.artifactId & ":" & q.version & " -> " & q.path, true );
}
```







# Categories

[Java](../../categories/java.md), [Lucee Server related Tags, Functions and Guides](../../categories/server.md), [DevOps](../../categories/devops.md)

# See Also

[MavenExists()](mavenexists.md), [MavenExport()](mavenexport.md), [MavenInfo()](maveninfo.md), [MavenLoad()](mavenload.md)