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