Search code examples
grailsgrails-3.0

how to set a grails 3 app to use a root context path?


I'm trying to set a root context path for my application in `conf/application.yml' like so:

server:
    'context-path': '/'

However, when trying to start grails> run-app, I get the following exception:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

Solution

  • I should have paid more attention to the error log output from run-app. The correct setting is:

    server:
        'context-path': ''
    

    >= Grails 3.0.3:

    server:
        contextPath: ''