Skip to content

Add Maven toolchains support for vertx:run - #787

Merged
tsegismont merged 1 commit into
reactiverse:masterfrom
tsegismont:toolchains
Oct 13, 2026
Merged

tsegismont merged 1 commit into
reactiverse:masterfrom
tsegismont:toolchains

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Closes #100

When a JDK toolchain is configured, the forked Vert.x application now uses the toolchain JDK instead of the JDK running Maven. Falls back to existing java.home/JAVA_HOME resolution when no toolchain is configured.

Replace class loading with ASM bytecode inspection in the launcher detection logic. The previous approach used URLClassLoader.loadClass() to walk the superclass hierarchy, which fails with UnsupportedClassVersionError when the user's code targets a higher JDK than the one running Maven (e.g. toolchain selects JDK 21 but Maven runs on JDK 11).

Assisted-By: Claude Opus 4.6

Closes #100

When a JDK toolchain is configured, the forked Vert.x application now uses the toolchain JDK instead of the JDK running Maven.
Falls back to existing java.home/JAVA_HOME resolution when no toolchain is configured.

Replace class loading with ASM bytecode inspection in the launcher detection logic.
The previous approach used `URLClassLoader.loadClass()` to walk the superclass hierarchy, which fails with `UnsupportedClassVersionError` when the user's code targets a higher JDK than the one running Maven (e.g. toolchain selects JDK 21 but Maven runs on JDK 11).

Assisted-By: Claude Opus 4.6
@tsegismont
tsegismont merged commit c50d8e3 into reactiverse:master Oct 13, 2026
7 checks passed
@tsegismont
tsegismont deleted the toolchains branch October 13, 2026 16:54
tsegismont added a commit to tsegismont/vertx-maven-plugin that referenced this pull request Oct 13, 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.

maven toolchains not used to set the java version

1 participant