How to hot-reload with vert.x 5 VertxApplication launcher

18 views
Skip to first unread message

Aleksandar Pavlovic

unread,
Aug 28, 2025, 9:13:56 AM (9 days ago) Aug 28
to vert.x
Hi everyone, 

We've started migration from vert.x 4 to vert.x 5. With vert.x 4, we are using Gradle with a customized run task similar to this:

val vertxRunTask = getByName<JavaExec>("run") {
systemProperty(
"vertx.logger-delegate-factory-class-name",
"io.vertx.core.logging.Log4j2LogDelegateFactory"
)
args = listOf(
"run",
com.acme.app.MyVerticle,
"-conf",
"conf/config.json",
"--redeploy=
src/main/kotlin/**/*",
"--launcher-class=io.vertx.core.Launcher",
"--on-redeploy=
../gradlew classes",
)
}

The redeploy arguments give us a hot-reload development experience.

After the upgrade to vert.x 5.0.3 and based on vertx-5-migration-guide, we added a new dependency to the project and changed the Gradle configuration as follows:
val runVertxTask = getByName<JavaExec>("run") {
systemProperty(
"vertx.logger-delegate-factory-class-name",
"io.vertx.core.logging.Log4j2LogDelegateFactory"
)
args = listOf(
mainVerticle,
"-conf",
"conf/config.json",
"--redeploy=src/main/kotlin/**/*",
"--on-redeploy=../gradlew classes",
)
}

The last 2 arguments:
--redeploy
--on-redeploy
makes the Gradle run task fail. 

When I remove them, my application starts, but is insensitive to any change in the code base.

I've tried to analyze the source code changes between v4 (launcher belongs to vert.x core module) and v5 (separated module), and what is possibly missing. As far as I see, RunCommand is the same, and the Watcher class is present in the source code. 

Someone had/have the same problem? How did you solve it?

Thanks

Thomas SEGISMONT

unread,
Aug 28, 2025, 12:45:45 PM (9 days ago) Aug 28
to ve...@googlegroups.com
Hi,

I think it should work if you add the vertx-launcher-legacy-cli library


The CLI framework has been removed in Vert.x 5. You can rely on the legacy CLI jar for now but there is no guarantee it will be maintained for the whole Vert.x 5 lifetime (although, as long as it doesn't break, I believe we'll keep it).

It seems you need the redeployment feature for development. This feature is now present in the Vert.x Maven plugin but not in the Vert.x Gradle plugin.

We're looking for a contributor to this project, would be interested?

Thanks,
Thomas

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/vertx/dec449cf-ebaf-42b8-8a0a-28e0f013e692n%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages