diff --git a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java index a87294e34fabb..d162a7dd8efb5 100644 --- a/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java +++ b/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcServerProcessor.java @@ -28,12 +28,14 @@ import io.grpc.internal.ServerImpl; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; import io.quarkus.arc.deployment.AnnotationsTransformerBuildItem; +import io.quarkus.arc.deployment.BeanArchivePredicateBuildItem; import io.quarkus.arc.deployment.CustomScopeAnnotationsBuildItem; import io.quarkus.arc.deployment.SyntheticBeansRuntimeInitBuildItem; import io.quarkus.arc.deployment.ValidationPhaseBuildItem; import io.quarkus.arc.processor.AnnotationsTransformer; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.BuiltinScope; +import io.quarkus.deployment.ApplicationArchive; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.IsNormal; import io.quarkus.deployment.annotations.BuildProducer; @@ -218,7 +220,7 @@ private Set gatherBlockingMethods(ClassInfo service) { AnnotationsTransformerBuildItem transformUserDefinedServices(CombinedIndexBuildItem combinedIndexBuildItem, CustomScopeAnnotationsBuildItem customScopes) { // User-defined services usually only declare the @GrpcService qualifier - // We need to add @GrpcEnableRequestContext and @Singleton if needed + // We need to add @GrpcEnableRequestContext and @Singleton if needed Set userDefinedServices = new HashSet<>(); for (AnnotationInstance annotation : combinedIndexBuildItem.getIndex().getAnnotations(GrpcDotNames.GRPC_SERVICE)) { if (annotation.target().kind() == Kind.CLASS) { @@ -393,4 +395,16 @@ void configureMetrics(GrpcBuildTimeConfig configuration, Optional() { + + @Override + public boolean test(ApplicationArchive archive) { + // Every archive that contains a generated implementor of MutinyBean is considered a bean archive + return !archive.getIndex().getKnownDirectImplementors(GrpcDotNames.MUTINY_BEAN).isEmpty(); + } + }); + } + }