Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure the port a Quarkus application runs on?

Tags:

quarkus

I would like my Quarkus application to run on a port other than the default. How can I accomplish that?

like image 782
geoand Avatar asked Mar 07 '19 12:03

geoand


2 Answers

You can use <projhome>/resources/application.properties to configure the port.

For example

quarkus.http.port=8080
%dev.quarkus.http.port=8811
%test.quarkus.http.port=7711
%server.quarkus.http.port=6611

Here dev, test, and server refer to the profiles.

You can run them as below

$ mvn compile quarkus:dev -- port 8811 will be used

$ mvn -Dquarkus-profile=server compile quarkus:dev -- port 6611 will be used

like image 200
Karats Mohanraj Avatar answered Oct 17 '22 03:10

Karats Mohanraj


The Quarkus configuration property to be used is quarkus.http.port (the default value is 8080). If this property is set in application.properties then that value will be used.

The property can also be overridden at runtime as follows:

When running a Quarkus application in JVM mode you can set the port using the quarkus.http.port System property. For example:

java -Dquarkus.http.port=8081 -jar example-runner.java

The same property applies to GraalVM Native Mode images. For example:

./example-runner -Dquarkus.http.port=8081
like image 44
geoand Avatar answered Oct 17 '22 02:10

geoand