You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "jglapa (via GitHub)" <gi...@apache.org> on 2026/02/16 10:10:54 UTC
[I] LinkGenerator initialisation [grails-core]
jglapa opened a new issue, #15391:
URL: https://github.com/apache/grails-core/issues/15391
### Expected Behavior
This is a follow up from https://github.com/apache/grails-core/issues/15330 that was incorrectly diagnosed.
To supplement production overrides other than the ones in application.groovy an extra override file can be used and loaded from external file.
This is done in `Application.groovy` by using the `EnvironmentAware` interface:
```groovy
@Override
void setEnvironment(Environment environment) {
Resource resourceConfig = new FileSystemResource('prod-overrides.groovy')
def parsedConfig = new ConfigSlurper().parse(resourceConfig.getURL())
environment.propertySources.addFirst(new MapPropertySource("prod-overrides", parsedConfig))
}
```
snippet above will add additional config changes based on a file `prod-overrides.groovy`
the file contains the following:
```
grails {
serverURL = 'https://grails7-absolute-link-issue.domain.com'
}
```
after starting the app by `./gradlew :bootRun` and hitting `http://localhost:8080/makeLink/index` we should get:
```
Link : https://grails7-absolute-link-issue.domain.com/makeLink/index/1
serverURL: https://grails7-absolute-link-issue.domain.com
```
this works fine with `grails6`
### Actual Behaviour
when you run the same example on `grails7`, we get:
```
Link : http://localhost:8080/makeLink/index/1
serverURL: https://grails7-absolute-link-issue.domain.com
```
### Steps To Reproduce
Run the example application (both versions) observe that grails7 manifest different behaviour. It seem the `LinkGenerator` initialisation happens earlier and ignores the extra overrides loaded with the additional config.
Looks like `asset.pipeline.grails.AssetPipelineAutoConfiguration` configures the `AssetSupportingCachingLinkGenerator` and does not account for the override.
### Environment Information
_No response_
### Example Application
https://github.com/jglapa/grails7-absolute-link-issue
### Version
7.0.7
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] LinkGenerator initialisation ignores additional config overrides [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #15391:
URL: https://github.com/apache/grails-core/issues/15391#issuecomment-3912295917
We imported the external config plugin into Grails 7 because it can be tricky to get this logic correct. Why are you using the lower level Spring APIs instead of https://grails.apache.org/docs/latest/guide/conf.html#externalConfiguration
Does it work if you use the built in method to include additional configuration files?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] LinkGenerator initialisation ignores additional config overrides [grails-core]
Posted by "jglapa (via GitHub)" <gi...@apache.org>.
jglapa commented on issue #15391:
URL: https://github.com/apache/grails-core/issues/15391#issuecomment-3914166540
> We imported the external config plugin into Grails 7 because it can be tricky to get this logic correct. Why are you using the lower level Spring APIs instead of https://grails.apache.org/docs/latest/guide/conf.html#externalConfiguration
>
> Does it work if you use the built in method to include additional configuration files?
My logic is a bit more complex but I can work with the externalConfiguration.
It will work fine.
Thank you for pointing this out. I'll close this, not and issue anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] LinkGenerator initialisation ignores additional config overrides [grails-core]
Posted by "jglapa (via GitHub)" <gi...@apache.org>.
jglapa closed issue #15391: LinkGenerator initialisation ignores additional config overrides
URL: https://github.com/apache/grails-core/issues/15391
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org