From 98f305c2dee356515bb48f6dc2188c4d807c2555 Mon Sep 17 00:00:00 2001 From: Sven Woltmann Date: Fri, 27 Oct 2023 11:19:02 +0200 Subject: [PATCH] Use Quarkus application framework - adapt README --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 47a85a9..d45297c 100644 --- a/README.md +++ b/README.md @@ -36,22 +36,25 @@ The `model` module is not represented as a hexagon because it is not defined by # How to Run the Application -The easiest way to run the application is to start the `main` method of the `Launcher` class (you'll find it in the `boostrap` module) from your IDE. +You can run the application in Quarkus dev mode with the following command: -You can use one of the following VM options to select a persistence mechanism: +```shell +mvn quarkus:dev +``` + +You can use one of the following system properties to select a persistence mechanism: * `-Dpersistence=inmemory` to select the in-memory persistence option (default) * `-Dpersistence=mysql` to select the MySQL option -If you selected the MySQL option, you will need a running MySQL database. The easiest way to start one is to use the following Docker command: +For example, to run the application in MySQL mode, enter: ```shell -docker run --name hexagon-mysql -d -p3306:3306 \ - -e MYSQL_DATABASE=shop -e MYSQL_ROOT_PASSWORD=test mysql:8.1 +mvn quarkus:dev -Dpersistence=mysql ``` -The connection parameters for the database are hardcoded in `RestEasyUndertowShopApplication.initMySqlAdapter()`. If you are using the Docker container as described above, you can leave the connection parameters as they are. Otherwise, you may need to adjust them. - +In dev mode, Quarkus will automatically start a MySQL database using Docker, +and it will automatically create all database tables. # Example Curl Commands