I cloned the vertx-when project and built it locally. To build it I had to switch from Java 7 to Java 8, which I did. The project is installed locally as "com.englishtown.vertx:vertx-when:4.0.0-SNAPSHOT".
I added this statement to my build.gradle:
compile "com.englishtown.vertx:vertx-when:4.0.0-SNAPSHOT"
I am able to run 'gradle install' or 'gradle fatjar' for my Vert.x application written in Groovy without any problems.
Here is the code, which gives me trouble:
package test
import org.vertx.groovy.core.eventbus.Message
import org.vertx.groovy.platform.Verticle
import org.vertx.java.core.Future
import com.englishtown.promises.WhenFactory
import com.englishtown.vertx.promises.WhenVertx
import com.englishtown.promises.When
import com.englishtown.vertx.promises.impl.DefaultWhenVertx
class ApplicationVerticle extends Verticle {
def start(Future startedResult) {
def config = container.config
When when = WhenFactory.createSync();
WhenVertx whenContainer = new DefaultWhenVertx(vertx, when);
...
I get a runtime error when trying to run either the ApplicationVerticle or the entire module.
On line When when = WhenFactory.createSync();
I get this error:
java.lang.NoClassDefFoundError: javax/inject/Provider
I found a post related to this error suggesting adding this line to Vert.x langs.properties
groovy=com.englishtown~vertx-mod-hk2~1.7.0:com.englishtown.vertx.hk2.HK2VerticleFactory
Adding this line causes another error when I try to run the Verticle (it has no effect on the module):
java.lang.NoClassDefFoundError: org/vertx/groovy/platform/Verticle
What is the proper way of integrating vertx-when with a Vert.x application?