How to change grails localhost port?

前端 未结 11 1378
情书的邮戳
情书的邮戳 2020-12-22 20:39

I\'m using grails 2.0.4. And I want to use port:8090 instead of 8080 for localhost. So need help to change the port to 8090 permanently.

相关标签:
11条回答
  • 2020-12-22 21:17

    This solution adds to the answers http://stackoverflow.com/a/10956283/122457. In Grails 2.x, add the following to BuildConfig.groovy:

    grails.server.port.http = 8090
    

    See http://forum.springsource.org/archive/index.php/t-97024.html for further details.

    0 讨论(0)
  • 2020-12-22 21:18

    You didn't say what IDE you are using. If you are using Netbeans you just right-click on the project name and choose Properties. From the General Settings Category, you can easily change the server port to whatever you like.

    0 讨论(0)
  • 2020-12-22 21:19

    command line: grails run-app -port 8090

    0 讨论(0)
  • 2020-12-22 21:20

    There are two options:

    1. Change grails.serverURL in Config.groovy from "http://localhost:8080/${appName}" to "http://localhost:8090/${appName}".
    2. Launch grails with -Dgrails.server.port.http=8090 on the command line. Set the GRAILS_OPTS environment variable to -Dgrails.server.port.http=8090 to have it applied automatically.
    0 讨论(0)
  • 2020-12-22 21:22

    If you are using IntelliJ IDE then

    From the application menu click Run >> Edit Configurations... >> VM options: -Dgrails.server.port.http=8180

    0 讨论(0)
  • 2020-12-22 21:23

    grails run-app -Dserver.port=8090

    Or use another port number

    In Intellij: Ctrl+Alt+G (keyboard Generic); Cmd+Alt+G (keyboard Mac) and use only:

    run-app -Dserver.port=8090

    0 讨论(0)
提交回复
热议问题