Working through the
Vert.x tutorial series and have reached the bottom of the first blog post. Trying to run the Vert.x program (written in Kotlin 1.0.6) with Gradle via its
run task and end up with the following output:
:compileKotlin UP-TO-DATE
:compileJava UP-TO-DATE
:copyMainKotlinClasses UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
Jan 22, 2017 4:42:15 PM io.vertx.core.Starter
INFO: vertx run <main> [-options]
runs a verticle called <main> in its own instance of vert.x.
valid options are:
// ....
Can run the program manually through java in the terminal just fine after executing the jar Gradle task. Below is the contents of build.gradle:
group 'io.vertx.blog'
version '0.1-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'io.vertx:vertx-core:3.3.3'
testCompile 'io.vertx:vertx-unit:3.3.3'
testCompile 'junit:junit:4.12'
}
run {
mainClassName = 'io.vertx.core.Starter'
}
jar {
from configurations.compile.collect { zipTree it }
manifest.attributes 'Main-Class': 'io.vertx.core.Starter'
manifest.attributes 'Main-Verticle': 'io.vertx.blog.first.MyFirstVerticle'
}
What is needed to get the Gradle run task to work successfully?