-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Consider allowing to exclude some beans from AOT processed applications #29484
Comments
spring-projects/spring-boot#33374 is another example of beans that aren't needed after AOT processing. |
I tentatively schedule this issue for Spring Framework |
Can this be implemented in a way that doesn't require me to use an annotation? I might want to manage bean definitions for classes that I didn't write or have no control over the annotations on. E.g. register bean definitions with a well-known attribute that says "I have a supplier already, you don't need to generate any code for me". I can already do this kind of manually, and it works in my use case, by registering a public class ExcludeFilter implements BeanRegistrationExcludeFilter {
static final String IGNORE_ME = "ignore.me";
@Override
public boolean isExcludedFromAotProcessing(RegisteredBean registeredBean) {
if (registeredBean.getMergedBeanDefinition().hasAttribute(IGNORE_ME)) {
return true;
}
return false;
}
} |
This commit annotates every generated class with `@Generated` so that build tools can recognize and ignore those types if necessary. Closes spring-projectsgh-29484
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@dsyer yes, as of 6.2, you can set |
See spring-projects/spring-boot#32262 for background.
Currently we have a number of areas where we want to exclude beans from being used in AOT processed applications. There are a number of ways we currently do this.
BeanRegistrationAotProcessor
then theisBeanExcludedFromAotProcessing
result is considered.BeanRegistrationExcludeFilter
inMETA-INF/spring/aot.factories
.if
withAotDetector.useGeneratedArtifacts()
in the actual code.It would be nice if we could review these existing usages and see if we can find a common way to perform exclusions.
The text was updated successfully, but these errors were encountered: