Skip to content

Add JPMS module path support for vertx:run - #791

Merged
tsegismont merged 1 commit into
reactiverse:masterfrom
tsegismont:jpms-module-path-support
Oct 15, 2026
Merged

tsegismont merged 1 commit into
reactiverse:masterfrom
tsegismont:jpms-module-path-support

Conversation

@tsegismont

Copy link
Copy Markdown
Member

When a Vert.x 5 project contains a module-info.java, the plugin auto-detects the modular setup and launches the application on the module path instead of the classpath. All project dependencies are placed on --module-path and the application is started with --module. Non-modular JARs become automatic modules transparently.

Module path mode is not compatible with loading verticles by class name (the vertx.verticle property), because class-name-based loading crosses module boundaries and breaks JPMS encapsulation. When a modular project has a verticle configured, the plugin logs a warning and falls back to classpath mode. However, a custom launcher extending VertxApplication that supplies verticles programmatically (e.g. via VertxApplicationHooks.verticleSupplier()) works on the module path without issues.

The useModulePath parameter controls this behavior: auto (default) enables module path when conditions are met, false forces classpath mode. Module name is read from the compiled module-info.class using ASM.

additionalDependencies work in both classpath and module path modes. additionalClasspathElements are classpath-mode only and ignored on the module path.

Assited-By: Claude Opus 4.6

When a Vert.x 5 project contains a `module-info.java`, the plugin auto-detects the modular setup and launches the application on the module path instead of the classpath. All project dependencies are placed on `--module-path` and the application is started with `--module`. Non-modular JARs become automatic modules transparently.

Module path mode is not compatible with loading verticles by class name (the `vertx.verticle` property), because class-name-based loading crosses module boundaries and breaks JPMS encapsulation. When a modular project has a verticle configured, the plugin logs a warning and falls back to classpath mode. However, a custom launcher extending `VertxApplication` that supplies verticles programmatically (e.g. via `VertxApplicationHooks.verticleSupplier()`) works on the module path without issues.

The `useModulePath` parameter controls this behavior: `auto` (default) enables module path when conditions are met, `false` forces classpath mode. Module name is read from the compiled `module-info.class` using ASM.

`additionalDependencies` work in both classpath and module path modes. `additionalClasspathElements` are classpath-mode only and ignored on the module path.

Assited-By: Claude Opus 4.6
@tsegismont
tsegismont merged commit 91164af into reactiverse:master Oct 15, 2026
7 checks passed
@tsegismont tsegismont added this to the 2.2.0 milestone Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant