Goal: create a working Vert.x projec using compiled Groovy verticles, Logback-based logging, and working unit and integration tests.
Starting with the original template, these are (roughly) the steps that I took to get the project in this state :
- Clone
- Remove unwanted files
- Rename package directories (this is more easily done outside of IDEA, alas)
- Add a groovy source directory and a groovy source file.
- Modify mod.json
- Run
gradle idea
to generate IDEA files - note that you must do this after you add groovy stuff.
##Open questions
- Java source attaches nicely in IDEA - why isn't groovy source attaching?
- How do you spin up multiple verticles? Looks like we still need an app starter verticle, which is consistent with Vertx 1.3.1. Not demonstrated yet.
- Where do logs go? This is determined by log config, which is in src/main/resources/Logback.groovy. However I haven't really got this to work with any confidence.
##Closed questions
- How do you run a compiled groovy verticle? Add
groovy:
to the mod.json - Where is mod.json documented? https://github.com/vert-x/vert.x/blob/docs_2.0.0/core_manual_groovy.md
- Where is the vertx version set? gradle.properties#vertxVersion. Valid strings can be inferred from https://github.com/vert-x/vert.x/tags, and what you get with those tags in the google group. It's pretty informal at this point.
- How do I add other dependencies to the build? Add a line to build.gradle like
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.13'
. Values can be inferred from maven repository values such as this mvnrepository.com entry for logback - How can I run an class that has a main() in it with gradle? I don't really want to do this; instead of a testing main, use a unit test. I would like to know for general interest though.
- Why does RecordParser seem to want to throw an exception? Compiled groovy verticles need to have special strings in mod.json. Without that special string, all hell breaks loose.
###Apology
Some of these questions are not vertx dependant - in fact many of them are gradle dependant, a build system with which I have a few hours of experience.