Now, we are ready to run our application. Execute the compile and quarkus:dev goals to build it and run it:
$ mvn compile quarkus:dev
After a few seconds, the application will be compiled and executed, as shown in the following log:
[INFO] Scanning for projects...
. . . .
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-rest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ hello-rest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/francesco/git/packt/Hands-On-Cloud-Native-Applications-with-Java-and-Quarkus/chapter2/hello-rest/target/classes
[INFO]
[INFO] --- quarkus-maven-plugin:1.0.0.Final:dev (default-cli) @ hello-rest ---
Listening for transport dt_socket at address: 5005
2019-11-11 13:10:34,493 INFO [io.qua.dep.QuarkusAugmentor] (main) Beginning quarkus augmentation
2019-11-11 13:10:35,078 INFO [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 585ms
2019-11-11 13:10:35,395 INFO [io.quarkus] (main) Quarkus 1.0.0.CR1 started in 1.079s. Listening on: http://0.0.0.0:8080
2019-11-11 13:10:35,397 INFO [io.quarkus] (main) Profile dev activated. Live Coding activated.
2019-11-11 13:10:35,397 INFO [io.quarkus] (main) Installed features: [cdi, resteasy]
Now, you can request the provided endpoint with the browser or a tool such as curl:
$ curl http://localhost:8080/helloworld
hello
You can stop the application with Ctrl + C, although we recommend keeping it running as we will be testing the hot reload feature soon!