Auto Redeploy Vert.x in IntelliJ IDEA
I’m using IntelliJ for Java development and I found that I was confused with how re-deployments would work for Vert.x. It turned it was simple, but it took a while to figure out.

- Maven
- Vert.x 3
- IntelliJ IDEA 2016
I set up the configuration of IntelliJ and the Vert.x Launcher so that when classes were modified, the app would redeploy. But it seemed to only work the first time.
Step 1 — activate redeploy for your Run Configuration


run io.vertx.example.HelloWorldEmbedded --redeploy="target/classes/**/*.class" --launcher-class=io.vertx.core.LauncherNote that “ — redeploy” points to our Java classes. (See the caption under the image). This is different than let’s say in Eclipse where you would redeploy based on changes in *.java files.
Step 2 — Create a mod.json file in src/main/resources

The contents of this file should be:
{
"main": "io.vertx.example.HelloWorldEmbedded",
"auto-redeploy": true
}Step 3 — Make changes to code, then redeploy.
IntelliJ doesn’t automatically build (for good reasons) so you’ll need to do the following:
- Run app, then make code change
- Select Build -> Rebuild Project or just press Cmd-Fn-F9.
- You’ll see the text INFO: Redeploying! — you can now refresh the browser (assuming this is a web app)
Some people like to set up a macro that builds the project upon save. That’s up to you. See https://www.jetbrains.com/help/idea/recording-macros.html for more details.
To reproduce with the example I used, clone https://github.com/vert-x3/vertx-examples and build the maven-simplest example and open up the pom.xml in IntelliJ. Then follow Step 1 and Step 2 above.
