Results 1 to 6 of 6

Thread: grails.serverURL in Config.groovy is ignored in STS run-app

Hybrid View

  1. #1

    Default grails.serverURL in Config.groovy is ignored in STS run-app

    Is there any way to have Springsource ToolSuite use the grails.serverURL when you use the grails run-app run configuration? I've changed

    Code:
     grails.serverURL = "http://localhost:8090/${appName}/"
    and when I call run-app from the tool, I get:

    Code:
    Server running. Browse to http://localhost:8080/${appName}
    It would make sense that, if you override the port number in Config.groovy, it would get picked up in run-app.

    Brian

  2. #2
    Join Date
    Nov 2007
    Posts
    420

    Default

    grails.server.port.http = 8090 in BuildConfig.groovy will do the trick

  3. #3

    Default Brilliant

    That works great. Thanks for the tip!

    Brian

  4. #4

    Default But how about...

    It would be preferable to put the port number in application.properties, and then refer to it in BuildConfig.groovy.

    BuildConfig.groovy
    Code:
    grails.server.port.http = ${app.portNumber}
    application.properties
    Code:
    app.portNumber=8090
    I tried this to no avail.Any thoughts?

    Brian

  5. #5
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    The intention behind application.properties is that only Grails should modify it. BuildConfig.groovy is the place for user configuration. Why do you want to put the setting in application.properties?

  6. #6

    Default

    Peter,

    I didn't know that configuration in BuildConfig.groovy was canonical, and that application.properties was not. I just had my thinking reversed, since property files seem to be a convenient place for configuring things like ports.

    I will adjust the brain and continue.

    Brian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •