# MavenExport()

Walks Lucee's local maven cache directory and returns a pom.xml string listing every cached artifact as a `<dependency>` entry.

The emitted pom uses a synthetic self-identifier (`com.example.lucee:mvn-cache-export:0`) with `<packaging>pom</packaging>` — it is a manifest of what is cached, not a buildable project. 

Scope is not recorded on disk so no `<scope>` is emitted; classifier is derived from the jar filename when present (e.g. native libraries like `sqlite-jdbc-3.47.0.0-linux-x86_64.jar` are exported with `<classifier>linux-x86_64</classifier>`).

Pairs with [MavenImport()](mavenimport.md) to snapshot and restore a cache state. Use `fileWrite( path, mavenExport() )` to persist the output.

**Introduced:** 7.1.0.98

```
MavenExport( );
```

**Returns:** string

*This function does not take any arguments.*

# Examples

Get the pom XML as a string:

```cfml
pomXml = mavenExport();
dump( parseXml( pomXml ), true );
```

Write the snapshot to disk:

```cfml
fileWrite( "/app/pom.xml", mavenExport() );
```

Snapshot after loading known-good dependencies — commit the pom, rehydrate elsewhere with [MavenImport()](mavenimport.md):

```cfml
mavenLoad( "org.apache.poi:poi-ooxml:5.2.5" );
mavenLoad( "com.google.guava:guava:32.1.3-jre" );
fileWrite( "/app/mvn-cache.xml", mavenExport() );
```

Audit what's in an environment's cache (count distinct coords):

```cfml
pom = xmlParse( mavenExport() );
count = arrayLen( xmlSearch( pom, "//*[ local-name()='dependency' ]" ) );
echo( "Cached deps: " & count, 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), [MavenImport()](mavenimport.md), [MavenInfo()](maveninfo.md), [MavenLoad()](mavenload.md)