Chapter 2. Creating the configuration quickstart project
The config-quickstart
project lets you get up and running with a simple Quarkus application using Apache Maven and the Quarkus Maven plug-in. The following procedure demonstrates how you can create a Quarkus Maven project.
Procedure
In a command terminal, enter the following command to verify that Maven is using JDK 11 and that the Maven version is 3.6.3 or higher:
mvn --version
- If the preceding command does not return JDK 11, add the path to JDK 11 to the PATH environment variable and enter the preceding command again.
To generate the project, enter the following command:
mvn io.quarkus:quarkus-maven-plugin:1.7.6.Final-redhat-00014:create \ -DprojectGroupId=org.acme \ -DprojectArtifactId=config-quickstart \ -DplatformGroupId=com.redhat.quarkus \ -DplatformVersion=1.7.6.Final-redhat-00014 \ -DclassName="org.acme.config.GreetingResource" \ -Dpath="/greeting" cd config-quickstart
This command creates the following elements in the
./config-quickstart
directory:- The Maven structure
-
An
org.acme.config.GreetingResource
resource -
A landing page that is accessible on
http://localhost:8080
after you start the application -
Example
Dockerfile
file insrc/main/docker
- The application configuration file
An associated test
NoteAlternatively, you can download a Quarkus Maven project to use in this tutorial from the Quarkus quickstart archive or clone the
Quarkus Quickstarts
Git repository. The exercise is located in theconfig-quickstart
directory.