December 2019
Intermediate to advanced
314 pages
6h 51m
English
Let's learn how to activate a specific profile by taking the prod profile in the preceding configuration as an example. First of all, we need to start a PostgreSQL instance named postgresProd and bind it to port 7432:
docker run --ulimit memlock=-1:-1 -it --rm=true --memory-swappiness=0 --name quarkus_Prod -e POSTGRES_USER=quarkus -e POSTGRES_PASSWORD=quarkus -e POSTGRES_DB=postgresProd -e PGPORT=7432 -p 7432:7432 postgres:10.5
Then, we need to provide profile information during the package phase, as follows:
mvn clean package -Dquarkus.profile=prod -DskipTests=true
When running the application, it will pick up the profile you specified in the package phase:
java -jar target/profiles-demo-1.0-SNAPSHOT-runner.jar
As an ...
Read now
Unlock full access