Skip to content
Back to skills

Java Dependencies

ASecurity

Add, update, remove and audit a module's Maven/JAR dependencies in MDL — Studio Pro's Module Settings → Java dependencies tab. Use when a Java action needs an external library, when bumping a library version, or when auditing which modules pull what.

  • 143 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 26, 2026
ai-agentsgojavabashsqldocker

Works with

  • cli

Security analysis

A100/100

Scanned November 22, 2026

npx -y skills add mendixlabs/mxcli --skill java-dependencies --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Java Dependencies?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Java Dependencies
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mendixlabs-java-dependencies/badge)](https://www.skillsdirectory.com/skills/mendixlabs-java-dependencies)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: java-dependencies
description: "Add, update, remove and audit a module's Maven/JAR dependencies in MDL — Studio Pro's Module Settings → Java dependencies tab. Use when a Java action needs an external library, when bumping a library version, or when auditing which modules pull what."
---
<!-- skill-index: generated by scripts/skill-index.py; make check-skill-index -->
## Find it fast

`sed -n '<from>,<to>p' SKILL.md` one section rather than reading the file;
`./mxcli syntax <topic>` answers *how do I write this* for a fraction of either.

| lines | section |
|---|---|
| 35-45 | When to Use This Skill |
| 46-57 | Listing Dependencies |
| 58-66 | Describing a Dependency |
| 67-104 | Adding a Dependency |
| 105-117 | Updating a Dependency |
| 118-132 | Managing Transitive Exclusions |
| 133-140 | Removing a Dependency |
| 141-156 | Jackson Version Gotcha |
| 157-181 | A JDBC Driver or Native Library in the Runtime |
| 182-192 | After Adding a Dependency |
| 193-203 | Coordinate Format |
| 204-207 | Related Skills |

<!-- /skill-index -->
# Managing Maven / JAR Dependencies

This skill explains how to add, update, and remove Maven/JAR dependencies in a
Mendix module using MDL. These are the dependencies declared in Studio Pro's
**Module Settings → Java dependencies** tab, stored as
`Projects$JarDependency` entries inside the module's `Projects$ModuleSettings`
unit.

## When to Use This Skill

- Adding a new external library for a Java action (Jackson, Apache HTTP client, etc.)
- Updating a library version across modules
- Disabling a dependency without removing it (`included = false`)
- Auditing which modules have JAR dependencies

If you only need to copy JARs into `vendorlib/` for a local build (without
registering them in module settings), that is a different operation and does
NOT require MDL.

## Listing Dependencies

```sql
-- All modules
LIST JAR DEPENDENCIES;

-- Single module
LIST JAR DEPENDENCIES IN MyModule;
```

Output columns: `module`, `group`, `artifact`, `version`, `included`.

## Describing a Dependency

```sql
DESCRIBE JAR DEPENDENCY MyModule 'com.fasterxml.jackson.core:jackson-databind';
```

Outputs an `ALTER MODULE ... ADD JAR DEPENDENCY (...)` block (bare `ADD`: add
`IF NOT EXISTS` before re-executing it against a module that has it).

## Adding a Dependency

```sql
mdl 1;
ALTER MODULE MyModule
  ADD JAR DEPENDENCY (
    group    = 'com.fasterxml.jackson.core',
    artifact = 'jackson-databind',
    version  = '2.21.2',
    included = true,
  );
```

- `included` defaults to `true` when set explicitly; always set it to be explicit.
- The coordinate `group:artifact` must be unique within the module: a bare
  `ADD` of a declared coordinate **fails**, so a project script holding it
  cannot be executed twice.

### In a re-runnable script: `IF NOT EXISTS`

```sql
mdl 1;
ALTER MODULE MyModule
  ADD JAR DEPENDENCY IF NOT EXISTS (
    group    = 'org.duckdb',
    artifact = 'duckdb_jdbc',
    version  = '1.1.3',
    included = true,
  );
```

Same semantics as `ADD ATTRIBUTE IF NOT EXISTS`: absent → added; present →
**left untouched**, "already exists — skipped", and a second exec writes nothing
("Unchanged jar dependencies …"). A present coordinate with a *different*
version is still not updated — the notice names the stored version and the
`SET … VERSION` to run. To pin the version as well, follow the guarded `ADD`
with `SET JAR DEPENDENCY '…' VERSION '…'`, which is also a no-op when restated.

## Updating a Dependency

```sql
mdl 1;
-- Change the version
ALTER MODULE MyModule
  SET JAR DEPENDENCY 'com.fasterxml.jackson.core:jackson-databind' VERSION '2.21.3';

-- Disable without removing (keeps the entry, classpath excluded at build time)
ALTER MODULE MyModule
  SET JAR DEPENDENCY 'com.fasterxml.jackson.core:jackson-databind' INCLUDED false;
```

## Managing Transitive Exclusions

```sql
mdl 1;
-- Exclude a transitive dependency
ALTER MODULE MyModule
  SET JAR DEPENDENCY 'org.duckdb:duckdb_jdbc'
    ADD EXCLUSION 'com.example:conflicting-lib';

-- Remove an exclusion
ALTER MODULE MyModule
  SET JAR DEPENDENCY 'org.duckdb:duckdb_jdbc'
    DROP EXCLUSION 'com.example:conflicting-lib';
```

## Removing a Dependency

```sql
mdl 1;
ALTER MODULE MyModule
  DROP JAR DEPENDENCY 'com.fasterxml.jackson.core:jackson-databind';
```

## Jackson Version Gotcha

Jackson 2.x and 3.x use different package namespaces:

| Version | Group ID | Import prefix |
|---------|----------|---------------|
| 2.x | `com.fasterxml.jackson.core` | `com.fasterxml.jackson.*` |
| 3.x | `tools.jackson.core` | `tools.jackson.*` |

If Java code imports `com.fasterxml.jackson.databind.*` you need **2.x**.
Pin to the version the Mendix runtime bundles to avoid classloader conflicts:

```bash
ls ~/.mxcli/mxbuild/<runtime-version>/runtime/bundles/ | grep jackson
```

## A JDBC Driver or Native Library in the Runtime

A library that registers itself with the JVM can be on the class path and still
not be found from a Java action. Reported building a SPARQL action on DuckDB
(`org.duckdb:duckdb_jdbc` 2.0.0.1) in Mendix 11.16 (ako/mxcli#2314; not
measured here):

1. **`DriverManager` does not see a userlib driver.** `DriverManager.getConnection("jdbc:duckdb:")`
   fails with `No suitable driver found`: the jar sits in the app's own class
   loader, which `DriverManager` does not search. Instantiate the driver class
   instead — `new org.duckdb.DuckDBDriver().connect("jdbc:duckdb:", new java.util.Properties())` —
   the same for any JDBC driver a dependency brings.
2. **DuckDB verifies an extension file against its core signing key.** A core
   extension installs from a bundled file (`INSTALL '<path>'`); a community one
   (`rdf`) is refused ("doesn't have a valid signature"), loading it by path is
   refused too, and the failed `INSTALL` closes the statement. What works: run
   `INSTALL rdf FROM community` once on a machine with network access, bundle the
   installed `rdf.duckdb_extension` with its `.info` file, copy both into
   `<extension_directory>/v<duckdb version>/<platform>/` (e.g. `v2.0.0/linux_amd64/`)
   at runtime, then `LOAD rdf` by name.
3. **Only a real build compiles Java.** `mxcli check` and `mxcli docker check`
   (`mx check`) do not, so a mistake in the body shows in `mxcli test --local` or
   `run --local` (`mxbuild --target=deploy`). `import com.mendix.core.Core;` is
   added for you when the code uses `Core`; any other class needs its import line.

## After Adding a Dependency

MDL writes the `Projects$JarDependency` entry into the `.mpr` file. Gradle
still needs to resolve and download the JAR:

1. Open the project in Studio Pro — it will trigger Gradle to populate `vendorlib/`.
2. Or run `mxcli docker build` which invokes `mx` and triggers the Gradle sync.

Until Gradle runs, the JAR is declared but not yet present in `vendorlib/`.
This is the same state as adding a dependency in Studio Pro before clicking OK.

## Coordinate Format

Coordinates use the `group:artifact` format (no version):

```
'com.fasterxml.jackson.core:jackson-databind'
'org.duckdb:duckdb_jdbc'
```

The version is stored separately and shown in `LIST JAR DEPENDENCIES` output.

## Related Skills

- [java-actions](../java-actions/SKILL.md) — authoring Java actions
- [project-settings](../project-settings/SKILL.md) — other module/project settings

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.