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

后端 未结 2 1909
旧巷少年郎
旧巷少年郎 2021-01-04 21:55

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

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 22:47

    To complement geoand’s answer, you can use the same property for mvn quarkus:dev. Unfortunately you cannot directly set it in a profile in ~/.m2/settings.xml to avoid the need to type it each time (for example because Microk8s binds 8080), but you can set it via jvm.args:

    
        
            microk8s-quarkus-dev
            
                true
            
            
                -Dquarkus.http.port=8090
            
        
    
    

    Alternately, you could configure this in project sources:

    echo '%dev.quarkus.http.port=8090' >> src/main/resources/application.properties
    

    though this would not be shared across projects, and might be unwanted by other developers of the same project.

提交回复
热议问题