---
url: /v7.2.0-SNAPSHOT/guide/advanced/maven-plugin.md
---

# UltiTools Maven Plugin

::: info Maven plugin and UltiTools-API 7.x
The Maven plugin is a separate artifact; its copy and publishing workflows have not been verified with a 7.x module.
:::

For a new 7.x module, follow [Quick Start](../quick-start.md). Use `ultikits create` from `@ultikits/cli` 3.0.0 or later (3.1.0 or later for the 7.1 template) to scaffold a project, or follow Quick Start to create it by hand. The Maven plugin does not scaffold projects and is not required to build or manually install a module.

## Plugin configuration

Add the published [Maven Central artifact](https://repo.maven.apache.org/maven2/com/ultikits/ultitools-maven-plugin/2.1.0/) under `<build><plugins>` in `pom.xml`. Include only the configuration for the goals you use:

```xml
<plugin>
    <groupId>com.ultikits</groupId>
    <artifactId>ultitools-maven-plugin</artifactId>
    <version>2.1.0</version>
    <configuration>
        <pluginFolder>/path/to/server/plugins/UltiTools/plugins</pluginFolder>
        <identifyString>example-module</identifyString>
    </configuration>
</plugin>
```

| Goal | Parameters and defaults |
|---|---|
| `install`, `deploy` | Read `fileName` (default `${project.build.finalName}.jar`) under `outputDirectory` (default `${project.build.directory}`). |
| `install` | `pluginFolder` is the copy destination. No default; the goal does nothing if it is unset. |
| `deploy` | `version` defaults to `${project.version}`. `name`, `shortDescription`, and `changelog` are optional and have no configured defaults. `allowSnapshot` defaults to `false`. |
| `deploy`, `withdraw`, `delete-module` | `identifyString` is required; use the module's UltiCloud identifier. `accessKeyFile` has no default; relative paths are resolved against `baseDir` (default `${basedir}`). `apiUrl` defaults to `https://api.ultikits.com` and can be set with `-Dultitools.apiUrl`. |

## Maven goals

### Local JAR copy

For an UltiTools-API 7.x module, Quick Start uses `mvn clean package` and a manual copy into `plugins/UltiTools/plugins/` while the server is stopped. Remove the old JAR when replacing your own build, then start the server. `/ul reload` does not load a new JAR.

In Maven plugin 2.1.0, `mvn clean package ultitools:install` packages the project and then copies the resulting JAR to `pluginFolder`, overwriting the destination if it has the same filename. `ultitools:install` is a plugin goal, not Maven's `install` lifecycle phase. Declaring the plugin without an execution does not run the goal automatically.

### UltiCloud publishing

`mvn clean package ultitools:deploy` packages the project and uploads the built JAR to UltiCloud. The goal reads a developer key from a nonblank `ULTIKITS_TOKEN` environment variable first, or from the first line of `accessKeyFile` otherwise. Keep keys out of the POM and version control.

An upload key can publish a version of an existing module. To let the goal create a missing module, supply `name` and use a manage key. The goal also attempts to sync configured `name` and `shortDescription` for existing modules; it skips the metadata update and continues the upload if the key lacks manage scope.

The goal rejects `-SNAPSHOT` module versions by default; use `-Dultitools.allowSnapshot=true` to opt in. This checks the module version being published, not the UltiTools-API dependency version. Set release notes with `-Dultitools.changelog="…"` (at most 5000 characters). The JAR limit is 50 MiB. A successful upload does not establish that the JAR loads on UltiTools 7.0.

### Version withdrawal and module deletion

`ultitools:withdraw` withdraws one published version. `ultitools:delete-module` deletes the module. Neither has a default phase. Both require a manage key and an exact confirmation. Keep the target version and confirmation out of shared Maven configuration; pass them explicitly on the command line after checking the target.

```shell
# Withdraw one published version.
mvn ultitools:withdraw -Dultitools.withdrawVersion=1.2.3 -Dultitools.confirm=example-module@1.2.3

# Delete the module.
mvn ultitools:delete-module -Dultitools.confirm=example-module
```

## Documentation and migration goals {#docs-and-migration}

As of v7.1.0, module and external-plugin Maven projects can use Maven plugin 2.1.0 to generate documentation and check migrations. Run these goals in the project that depends on the framework:

```bash
mvn com.ultikits:ultitools-maven-plugin:2.1.0:docs
mvn com.ultikits:ultitools-maven-plugin:2.1.0:check-migration
```

When listed in `<execution><goals>` in the POM, `docs` defaults to `generate-resources` and `check-migration` to `process-sources`. The [7.1 scaffold](./ultikits-cli#scaffold-tests) (CLI 3.1.0 or later) explicitly binds `docs` to `initialize` so migration diagnostics can point to files that already exist. Declaring the plugin without a goal execution does not run either automatically.

| Goal | POM parameter | Command-line property | Default and effect |
| --- | --- | --- | --- |
| `docs` | `skip` | `ultitools.docs.skip` | `false`; set to `true` to skip the whole goal |
| `docs` | `downloadGuide` | `ultitools.docs.downloadGuide` | `true`; setting it to `false` still extracts embedded docs but omits the online full guide |
| `docs` | `docsSiteUrl` | `ultitools.docs.siteUrl` | `https://dev.ultikits.com`; base site for the resolved framework version's English guide |
| `check-migration` | `skip` | `ultitools.migration.skip` | `false`; set to `true` to skip the source check |

Pass properties as `-Dproperty=value`. Both goals have a POM parameter named `skip`; to skip just one, configure it inside that goal's `<execution>` or use its distinct command-line property. `docs` writes to `${project.build.directory}/ultitools-docs/`. Offline Maven uses only a matching cached guide. A failed download does not fail the build. Maven waits 24 hours before retrying; by default, a cached `-SNAPSHOT` guide also refreshes at most once every 24 hours. Pass `-U` to retry a failed download or refresh a snapshot guide immediately.

`check-migration` reads the migration table directly from the framework JAR and does not depend on a guide download. It scans class and annotation references in main and test Java sources. Removed entries fail the build; deprecated entries warn.

UltiTools-API 7.0.0 and earlier have no embedded documentation bundle or migration table. With these versions, `docs` can still provide `VERSION` and the online guide, but `check-migration` skips the scan. The build can succeed with `Checked 0 Java file(s) against 0 class/annotation migration row(s)`. Both counts must be nonzero for any source to have been checked against a rule. See [project guidance for coding agents](./ai-agents) for the generated files and where to start reading.
