‏ ‏ ‎ ‏ ‏ ‎

Credits to Mr. Christian Aberger - this notes are based on his lecture @ HTL Leonding

1. Create a Quarkus-App at quarkus.io

Create a repo and push to gh. The first time, you have to approve the push to github.

quarkus 001

Clone the repo to your local machine

quarkus 002

git clone https://github.com/htl-leonding/gh-actions-demo.git

1.1. First Try - Run your Quarkus App

./mvnw clean compile quarkus:dev
curl localhost:8080/hello
result
Hello RESTEasy

1.2. Change Quarkus Package Type

  • To deploy the jar-file on the remote server, we have to include all dependencies into the jar-file.

1.2.1. Package Types

  • quarkus.package.type=uber-jar

    • fast-jar (default)

    • legacy-jar for the pre-1.12 default jar packaging,

    • uber-jar

    • native

1.2.2. Configuration in Quarkus

  • There are plenty of configuration options available (more information)

  • Basically there are three ways to configure a quarkus app

    1. Add an entry to application.properties

      quarkus.package.type=uber-jar
    2. Add an parameter when invoking maven

      ./mvnw clean package -Dquarkus.package.type=uber-jar
    3. Add an entry to the pom.xml

      <properties>
        <quarkus.package.type>uber-jar</quarkus.package.type>
        ...
      </properties>

1.3. Compile the Quarkus App

After compiling and packaging …​
./mvnw clean package -Dquarkus.package.type=uber-jar
...you get a -runner - jar with all dependencies included
-rw-r--r--   1 stuetz  staff    10M Mar 13 19:17 gh-actions-demo-1.0.0-SNAPSHOT-runner.jar
-rw-r--r--   1 stuetz  staff   4.7K Mar 13 19:17 gh-actions-demo-1.0.0-SNAPSHOT.jar.original

1.4. Run the jar-File

java -jar target/gh-actions-demo-1.0.0-SNAPSHOT-runner.jar

1.5. Check the Endpoint

curl http://localhost:8080/hello
Result
Hello RESTEasy