-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development environment configuration file application-development.groovy not documented #1012
Comments
Hi @snider32, can you double-check that you have spelled everything correct in your // grails-app/conf/application.groovy
environments {
development {
my.message = 'Hello, Development!'
}
production {
my.message = 'Hello, Production!'
}
} // grails-app/init/g533app/Bootstrap.groovy
package g533app
import grails.core.GrailsApplication
class BootStrap {
GrailsApplication grailsApplication
def init = { servletContext ->
println grailsApplication.config.getProperty('my.message', String, 'No message found!')
}
} |
Hi matrei, Thanks for giving it a look. Maybe a different pair of eyes will see something I don't. Here's my last iteration of application.groovy before successfully using application-development.groovy (with my comments stripped): grails.plugin.springsecurity.roleHierarchy = ''' grails.plugin.springsecurity.rejectIfNoRule = true grails.plugin.springsecurity.controllerAnnotations.staticRules = [ grails.plugin.springsecurity.logout.postOnly = false grails.plugin.springsecurity.securityConfigType = "Annotation" grails.plugin.springsecurity.filterChain.chainMap = [ logging.level.org.springframework.security.web.FilterChainProxy=DEBUG grails.plugin.springsecurity.useBasicAuth = true grails.plugin.springsecurity.registerLoggerListener = true environments {
} grails.plugin.springsecurity.onAuthorizationEvent = { e, appCtx -> |
I am not completely sure but can you please try moving the following before the environments block:
Also, how are you sure that the configurations from |
Expected Behavior
I expected application.groovy to be adequate for a development environment build, with environment blocks withing that file to distinguish code intended specifically for a build.
Actual Behaviour
It turns out that application.groovy is ignored for a development environment build, and an application-development.groovy file is required instead. I was not able to find any documentation about this - certainly not in the Spring Security Core Plugin - Reference Documentation. I've spent an awful lot of time chasing what was going on.
Steps To Reproduce
Using a gradle.properties file with org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M -Dgrails.env=dev
Environment Information
MacOS 12.7.4
grailsVersion=5.3.6
groovyVersion=3.0.11
org.grails.plugins:spring-security-core:5.3.0
jdk-17.jdk
IntelliJ IDEA 2023.2.6 (Ultimate Edition)
Example Application
No response
Version
5.3.6
The text was updated successfully, but these errors were encountered: