项目作者: alexvetter

项目描述 :
This is a very simple example to show how to get goin' with Vert.x, Scala and Gradle.
高级语言: Scala
项目地址: git://github.com/alexvetter/vertx3-gradle-scala.git
创建时间: 2017-02-22T09:32:44Z
项目社区:https://github.com/alexvetter/vertx3-gradle-scala

开源协议:MIT License

下载


vertx-lang-scala with Gradle

This is a very simple example to show how to get goin’ with Vert.x (3.4.0.Beta1), Scala (2.12.1) and Gradle (3.4).
It contains two simple ScalaVerticle written in Scala and based on vertx-lang-scala:

  1. com.example.Starter
  2. com.example.HttpVerticle

The Starter will deploy the HttpVerticle.
And the HttpVerticle will obviously start a HTTP server running on 8080 by default.

Running it with Gradle

  1. ./gradlew run

It’s as simple as that. The responsible part in the build.gradle is also fairly simple:

  1. mainClassName = "io.vertx.core.Launcher"
  2. def mainVerticle = "scala:com.example.Starter"
  3. run {
  4. args = ["run", mainVerticle]
  5. }

Building a fat JAR

This example uses Gradle Shadow to build a fat JAR.

  1. ./gradlew jar

… or ./gradlew build which will also run the jar task.
The resulting fat JAR will be located at build/libs/vertx3-gradle-scala-fat.jar.