Vertx reload hotswap

1,000 views
Skip to first unread message

Micah Smith

unread,
Dec 18, 2015, 10:36:40 AM12/18/15
to vert.x
I'm trying to achieve hotswap functionality to speed up development.

I started using the vertx-reload plugin below, which relies on dcevm to hotswap classes.

My problem is, I can't figure out how to pass in my config.json.  I have to use gradle for this project and am still new to it. Is this possible? If not, what gradle setups are people using for hotswap in vertx?

Clement Escoffier

unread,
Dec 18, 2015, 11:11:44 AM12/18/15
to ve...@googlegroups.com
Hi,

There is a redeploy feature provided by the default vert.x launcher:

So, for gradle, it should works as follow:

# build your project
./gradlew shadowJar
# launch your application in redeploy mode
java -jar build/libs/gradle-verticle-3.2.0-fat.jar --redeploy="src/**/*.java" --on-redeploy='./gradlew shadowJar’

The on-redeploy is the command rebuilding your project.

Clement


--
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.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/c7344b2b-b74d-413d-bd85-43ccbbf535ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Micah Smith

unread,
Dec 22, 2015, 3:14:38 PM12/22/15
to vert.x
Thanks for this! Ive checked out the documentation and am able to get it working in Intellij, but not gradle. Heres what my Intellij app config looks like:
Main class: io.vertx.core.Launcher
Program arguments: run com.postsurge.web.MainVerticle  --redeploy=**/*.class --launcher-class=io.vertx.core.Launcher

My gradle looks like this:
mainClassName = "io.vertx.core.Launcher"
shadowJar {
classifier = 'fat'

manifest {
attributes "Main-Verticle": mainVerticle
}

mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}


and as you instructed i run:
./gradlew shadowJar
java -jar build/libs/web-fat.jar --redeploy="src/**/*.java" --on-redeploy="./gradlew shadowJar"

The file watcher is working as I receive this output upon saving a file. If i should see the "gradlew shadowJar" ouput, i am not:
INFO: Succeeded in deploying verticle
Dec 22, 2015 2:13:41 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeploying!
Stopping vert.x application 'bc4b94c5-7495-4d5d-adf2-3fa66fbb0553-redeploy'
Application 'bc4b94c5-7495-4d5d-adf2-3fa66fbb0553-redeploy' stopped.
Starting vert.x application...
bc4b94c5-7495-4d5d-adf2-3fa66fbb0553-redeploy
Dec 22, 2015 2:13:41 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeployment done
Dec 22, 2015 2:13:41 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle


Any thoughts?

Clement Escoffier

unread,
Dec 23, 2015, 2:06:50 AM12/23/15
to ve...@googlegroups.com
Hi,

Are you using 3.2.0 ?

Clement


Micah Smith

unread,
Dec 23, 2015, 10:08:01 PM12/23/15
to vert.x
Nope, I sure wasn't. I upgraded to 3.2.0 and it appears to work now. :)    Thanks for all the help and Merry Christmas/Happy Holidays!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages