defaultPackage ignored in application.groovy on 3.1.7 #10005

Closed
madeupname opened this Issue Jun 21, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@madeupname

This is using Grails 3.1.7 on JDK8 on Windows 8.1. Initially reported on StackOverflow:

http://stackoverflow.com/questions/37911129/grails-defaultpackage-ignored

The configuration setting grails.codegen.defaultPackage does not take effect when in application.groovy as such:

grails {
    profile = "web"
    codegen {
        defaultPackage = 'com.madeupname.web'
    }
    spring{
        transactionManagement{
            proxies = false
        }
    }
}

The app name is not used as a default, either:

| Enter a command name to run. Use TAB for completion:
grails> create-controller ThingController
| Created grails-app/controllers/@artifact.package.path@/ThingController.groovy
| Created src/test/groovy/@artifact.package.path@/ThingControllerSpec.groovy

If you place this in application.yml, it works:

grails:
    codegen:
        defaultPackage: com.madeupname.web

While it's clear that YAML is the default, the Grails configuration docs describe it as "an alternative format," suggesting that everything should still work in application.groovy.

If that's not the case, the docs should be updated to strike that phrase and include a list of configuration settings that only work in application.yml.

@graemerocher

This comment has been minimized.

Show comment
Hide comment
@graemerocher

graemerocher Jun 21, 2016

Member

Currently on application.yml is parsed by the command line

Member

graemerocher commented Jun 21, 2016

Currently on application.yml is parsed by the command line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment