Starter Template project for creating a Vert.x module with a Gradle build.
Clone this and adapt it to easily develop Vert.x modules using Gradle as your build tool.
By default this module contains a com.mycompany.myproject.HelloWorldVerticle example application implemented in all stable language implementations currently supported by vert.x.
This template provides a gradle 2.2 wrapper.
Clone this repo, replace origin with your preferred one and run gradlew to test whether everything is working.
git clone git@github.com:macedigital/vertx-gradle-template.git <name of your project>
cd <name of your project>
git remote rm origin
git remote add origin <path to your repo>
./gradlew test For further details go to http://vertx.io/gradle_dev.html.
You can configure many things in gradle.properties:
- Change
modowner,modnameandversionto your liking as described in the modules manual. pullInDepsdetermines whether all module dependencies should be packaged into the module as nested module (default: true).produceJarSet to true if you want the build to output a jar as well as a module zip file (default: true).createFatJarSet to true if you want to build a fat executable jar containing everything needed to run the module (default: false).
Remove or add dependencies in build.gradle:
- Depending on your chosen programming language(s) you can safely remove lang-mods you neither want nor need in
dependencies. - If you plan on publishing your mod to Maven, you will want to edit
configurePom.
You can provide default module configuration if any in conf.json.
You can use the idea and eclipse Gradle plugins to create the project files for your IDE.
./gradlew ideaOr
./gradlew eclipseOnce the IDE files have been created you can open the project in your IDE.
See the build script for the list of useful tasks
-
gradle command
runModfails to find classpath:- invoking the script
env -u VERTX_MODS ./gradlew runModcan help if developing a single module
- invoking the script
-
Running / compiling JRuby verticle fails with
org.vertx.java.core.VertxException: org.jruby.embed.EvalFailedException: (Errno::ENOENT) <some/directory>- manually create <some/directory> and try again
-
JRuby fails with
LoadError: no such file to load -- rubygems- try setting
RUBYOPTenvironment variable, e.g.export RUBYOPT=rubygems && ./gradlew runMod1.
- try setting
-
Task 'runMod' fails with java.lang.ClassNotFoundException:
- Besides the obvious, also check if you have the
VERTX_MODSenvironment variable set. If so, unset it by running gradle wrapper like so insteadenv -u VERTX_MODS ./gradlew runMod.
- Besides the obvious, also check if you have the