This project demonstrates how to use the Vert.x Maven service factory. The Vertx Maven service factory lets you deploy and runs verticles packaged in Maven artifacts.
The Maven service factory verticle project is an example of verticle that you can deploy using the Maven service factory. The project contains a very simple verticle but also a description specifying the main verticle class.
To build this verticle just launch mvn clean install
from the maven-service-factory-verticle project. Install is
important as it needs to be stored in the Maven local repository.
You can run the verticle from anywhere using:
vertx run maven:io.vertx:maven-service-factory-verticle:3.4.2::my-verticle
The identifier is constructed as follows:
maven
+ :
+ the groupId + :
+ the artifactId + :
+ the version + ::
+ the name of the verticle
Note
|
The name of the verticle is the name of the json (descriptor) file. |
You can also deploy the verticle using the vertx.deployVerticle
method. An example is given in the
Maven service factory api project. In
this verticle, the previous
verticle is deployed using:
vertx.deployVerticle("maven:io.vertx:maven-service-factory-verticle:3.4.2::my-verticle", r -> { ... });
To run this project just launch:
cd maven-service-factory-api mvn clean package vertx run io.vertx.examples.MyDeployingVerticle -cp target/maven-service-factory-api-3.4.2.jar