Change the Better World

How to change server port at Spring boot 본문

Build Automation/Gradle

How to change server port at Spring boot

white_cheetah 2022. 9. 27. 21:49
1. Change spring boot server port in application.properties or application.yml file
    - application.properties
        server.port=8081
    - application.yml
        server
          port=8081

2. Change it at command line argument
    - example
       java -Dserver.port=8081 -jar ****.jar

3. at intellij
    - example
       Run/Debu Configurations -> VM options
       : in VM option, type "-Dserver.port=8081"

4. using gradle bootRun
    - example
       "gradle bootRun -Pargs=--server.port=8082" in command line at the root project
Comments