Skip to content
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

Asset pipeline creates and overrides grailsLinkGenerator created by ControllersPlugin #361

Open
codeconsole opened this issue Nov 21, 2024 · 0 comments

Comments

@codeconsole
Copy link
Contributor

codeconsole commented Nov 21, 2024

grailsLinkGenerator is created by the UrlMappingsPlugin

Since the asset-pipeline-grails depends on this plugin,

implementation("org.grails:grails-plugin-url-mappings")

this code doesn't do anything useful and can be deleted:

grailsLinkGenerator(cacheUrls ? CachingLinkGenerator : LinkGenerator, serverURL) { bean ->
bean.autowire = true
}

Causes:

Overriding bean definition for bean 'grailsLinkGenerator' with a different definition: replacing [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=org.grails.plugins.web.mapping.UrlMappingsAutoConfiguration; factoryMethodName=grailsLinkGenerator; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/grails/plugins/web/mapping/UrlMappingsAutoConfiguration.class]] with [Generic bean: class=asset.pipeline.grails.CachingLinkGenerator; scope=singleton; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null]

Should probably check if bean exists before creating a new one and overriding existing behavior, but I don't understand a scenario where the bean would not exist because this plugin depends on grails-plugin-url-mappings which creates it 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant