commit | author | age
|
4829e4
|
1 |
= Vert.x Simplest Maven project |
J |
2 |
|
|
3 |
This project shows a very simple hello world Vert.x project using Maven, which has a simple HTTP server which |
|
4 |
simply returns "Hello World!" to every request. |
|
5 |
|
|
6 |
In this example Vert.x is used embedded. I.e. we use the Vert.x APIs directly in our own classes rather than deploying |
|
7 |
the code in verticles. |
|
8 |
|
|
9 |
You can run or debug the example in your IDE by just right clicking the main class and run as.. or debug as... |
|
10 |
|
|
11 |
The pom.xml uses the Maven shade plugin to assemble the application and all it's dependencies into a single "fat" jar. |
|
12 |
|
|
13 |
To run with maven |
|
14 |
|
|
15 |
mvn compile exec:java |
|
16 |
|
|
17 |
To build a "fat jar" |
|
18 |
|
|
19 |
mvn package |
|
20 |
|
|
21 |
To run the fat jar: |
|
22 |
|
|
23 |
java -jar target/maven-simplest-3.9.0-fat.jar |
|
24 |
|
|
25 |
(You can take that jar and run it anywhere there is a Java 8+ JDK. It contains all the dependencies it needs so you |
|
26 |
don't need to install Vert.x on the target machine). |
|
27 |
|
|
28 |
You can also run the fat jar with maven: |
|
29 |
|
|
30 |
mvn package exec:exec@run-app |
|
31 |
|
|
32 |
Now point your browser at http://localhost:8080 |