I have a java library that I want to use inside a quarkus application, this library has a custom annotation that I want to use for bean loading so I wrote a quarkus extension and tried the BeanDefiningAnnotationBuildItem approach.
Extract from the extension deployment module:
static DotName OP_RULE_ANNOTATION = DotName.createSimple(OpRule.class.getName());
static DotName SINGLETON = DotName.createSimple(Singleton.class.getName());
@BuildStep
void additionalBeanAnnotations(BuildProducer<BeanDefiningAnnotationBuildItem> beanDefiningAnnotations) {
beanDefiningAnnotations.produce(new BeanDefiningAnnotationBuildItem(OP_RULE_ANNOTATION, SINGLETON, false));
}
The annotation is correctly detected and beans are loaded but when I try to inject them they are wrapped by a proxy and it looks like the Singleton scope is ignored.
Does anyone have any hint on how I can debug this?
update: While adding tests to the extension I also added a test to ensure that those classes would have not been wrapped by a Proxy and it passed, I do not have any special config on the application (that I know of)