About
Distribution deployment is the deployment of a verticle that is based on the availability of a vertx distribution
Articles Related
Steps
- Create a distribution of your application that contains:
- your verticle
- and its non-vertx dependency
Example with gradle and the java library distribution
plugins {
id 'java'
id 'java-library-distribution'
}
dependencies {
// Vert.x
compileOnly "io.vertx:vertx-core:$vertxVersion"
// Web
compileOnly "io.vertx:vertx-web:$vertxVersion"
compileOnly "io.vertx:vertx-web-client:$vertxVersion"
// Database
compileOnly "io.vertx:vertx-jdbc-client:$vertxVersion"
api "org.hsqldb:hsqldb:2.5.0"
// Vertx service
compileOnly "io.vertx:vertx-service-proxy:$vertxVersion"
compileOnly "io.vertx:vertx-codegen:$vertxVersion"
annotationProcessor "io.vertx:vertx-codegen:$vertxVersion:processor"
// <3.8.4
// annotationProcessor "io.vertx:vertx-service-proxy:$vertxVersion:processor"
compileOnly "io.vertx:vertx-service-proxy:$vertxVersion"
annotationProcessor "io.vertx:vertx-service-proxy:$vertxVersion"
}
- By running the distZip tasks, You get the verticle and its runtime dependencies in a zip format. Example unzipped:
- Copy the zip to your server
- Unzip it into a directory (generally /verticles)
Example:
- with the Vert.x client
cd /verticles # the location of the verticle jar
vertx run com.company.vertxapp.MainVerticle
-cp /verticles/MY_VERTICLE.jar;/verticles/lib/*
- or via docker
cd /verticles
docker run -i -t -p 8080:8080 \
-v $PWD:/verticles \
vertx/vertx3-exec \
run com.company.vertxapp.MainVerticle \
-cp /verticles/MY_VERTICLE.jar;/verticles/lib/*