-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
Grails 5.0.0.M2: property inside plugin has no effect on environment configuration (extension to #11519) #11767
Comments
So as I am currently trying to implement a workaround to make our app work, I experimented with the following extension to
During this I had to debug a lot through Spring and Micronaut and I discovered the following, which I found kinda odd and also prevents my workaround above from working: I placed a breakpoint inside the constructor of the class The first time on the line: So the merge of the micronaut property sources (from my workaround) with the Spring context should happen at this line: grails-core/grails-core/src/main/groovy/grails/boot/GrailsApp.groovy Lines 186 to 188 in e8a6adb
But at the time of execution, the active environment is actually the second instance that was created. Then after the parent context is set, the following is executed: These lines finally set the environment to the first instance that was created in From a theoretical standpoint I would expect there would be created exactly one Spring environment and one Micronaut environment, so this behavior seems rather strange to me. Is this expected to work like that? |
Fixing configuration loading with Micronaut (issue #11767)
This commit changes the behavior of the GrailsApplicationPostProcessor so that it no longer creates a new plugin manager if a plugin manager already exists in the application context. Resolves grails#11767 Related grails/grails-functional-tests#208
This commit changes the behavior of the GrailsApplicationPostProcessor so that it no longer creates a new plugin manager if a plugin manager already exists in the application context. Resolves #11767 Related grails/grails-functional-tests#208
This is an extension to the already closed issue #11519
The example which I described in my initial issue where a call to
environment.getProperty('grails.databinding.dateFormats')
insideBootStrap
doesn't return the values from plugin.yml does work now.But I discovered another use-case where it still doesn't work:
My example of configuring some default framework parameters like
grails.databinding.dateFormats
inside a "core"-plugin still doesn't work. The concrete problem in the databinding case seems to be, that the configuration is now implemented as a Micronaut@ConfigurationProperties
bean:And to me it seems that the configuration from the plugins gets added to the Micronaut context very late:
grails-core/grails-core/src/main/groovy/grails/boot/GrailsApp.groovy
Lines 99 to 107 in 77843bd
At this point the application context is already created.
Edit:
What also doesn't seem to work: when I add a custom Micronaut
PropertySourceLoader
the properties loaded with it are not available in the Grails application bygrailsApplication.config
.Task List
Steps to Reproduce
Expected Behaviour
Configuration properties from plugins should be loaded already in the Micronaut context.
Actual Behaviour
Configuration is loaded when Micronaut context is already setup.
Environment Information
The text was updated successfully, but these errors were encountered: