helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.44k stars 562 forks source link

Helidon MP fails to list @Grpc annotated services on gradle #8907

Open Baron1Pampa opened 1 week ago

Baron1Pampa commented 1 week ago

Environment Details


Problem Summary

I'm trying to run grpc server with Helidon MP using gradle(this is important). When trying to run basic example using mvn, everything works corrects

Problem Description

public class MainClass { public static void main(String[] args) { Server.builder().build().start(); } }

- pom.xml 

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>copy-of-microprofile-grpc</artifactId>
<name>Dummy grpc Server</name>
<dependencies>
    <dependency>
        <groupId>io.helidon.microprofile.bundles</groupId>
        <artifactId>helidon-microprofile</artifactId>
        <version>3.2.2</version>
    </dependency>
    <dependency>
        <groupId>io.helidon.microprofile.grpc</groupId>
        <artifactId>helidon-microprofile-grpc-server</artifactId>
        <version>3.2.2</version>
    </dependency>
</dependencies>


- gradle.build.kts

plugins { id("java") application }

group = "org.example" version = "1.0-SNAPSHOT"

repositories { mavenCentral() }

dependencies { implementation("io.helidon.microprofile.bundles:helidon-microprofile:3.2.2") implementation("io.helidon.microprofile.grpc:helidon-microprofile-grpc-server:3.2.2") }

application { mainClass.set("implicit.MainClass") }

Output when running the example with mvn:

[Mon Jun 24 14:50:24 IDT 2024] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties [Mon Jun 24 14:50:24 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup - WELD-000900: 4.0.3 (Final) [Mon Jun 24 14:50:25 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension - ConfigCdiExtension instantiated [Mon Jun 24 14:50:25 IDT 2024] INFO: io.helidon.microprofile.openapi.OpenApiCdiExtension - OpenAPI support could not locate the Jandex index file META-INF/jandex.idx so will build an in-memory index. This slows your app start-up and, depending on CDI configuration, might omit some type information needed for a complete OpenAPI document. Consider using the Jandex maven plug-in during your build to create the index and add it to your app. [Mon Jun 24 14:50:25 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension - ConfigCdiExtension instantiated [Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create - WELD-ENV-000020: Using jandex for bean discovery [Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup startContainer - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously. [Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] private io.helidon.microprofile.openapi.OpenApiCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. [Mon Jun 24 14:50:25 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jersey.ext.cdi1x.internal.ProcessAllAnnotatedTypes.processAnnotatedType(@Observes ProcessAnnotatedType<?>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. [Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.tracing.tracerresolver.TracerResolverBuilder build - TracerResolver not configured, tracing is disabled [Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authentication provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). Security will not have any valid authentication provider [Mon Jun 24 14:50:26 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authorization provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). ABAC provider is configured for authorization. [Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]: registered service [StringService] [Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl deploy - gRPC server [test.server]: with methods [StringService/echo]

[Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl start - gRPC server [test.server]: listening on port 1408 (TLS=false) [Mon Jun 24 14:50:27 IDT 2024] INFO: io.helidon.microprofile.grpc.server.GrpcServerCdiExtension lambda$startServer$3 - gRPC server started on localhost:1408 (and all other host addresses) in 150 milliseconds.


Output when running with gradle:

[Mon Jun 24 15:14:01 IDT 2024] INFO: io.helidon.common.LogConfig doConfigureLogging - Logging at initialization configured using classpath: /logging.properties [Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup - WELD-000900: 4.0.3 (Final) [Mon Jun 24 15:14:01 IDT 2024] INFO: io.helidon.microprofile.openapi.OpenApiCdiExtension - OpenAPI support could not locate the Jandex index file META-INF/jandex.idx so will build an in-memory index. This slows your app start-up and, depending on CDI configuration, might omit some type information needed for a complete OpenAPI document. Consider using the Jandex maven plug-in during your build to create the index and add it to your app. [Mon Jun 24 15:14:01 IDT 2024] FINE: io.helidon.microprofile.config.ConfigCdiExtension - ConfigCdiExtension instantiated [Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create - WELD-ENV-000020: Using jandex for bean discovery [Mon Jun 24 15:14:01 IDT 2024] INFO: org.jboss.weld.bootstrap.WeldStartup startContainer - WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously. [Mon Jun 24 15:14:02 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] public org.glassfish.jersey.ext.cdi1x.internal.ProcessAllAnnotatedTypes.processAnnotatedType(@Observes ProcessAnnotatedType<?>, BeanManager) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. [Mon Jun 24 15:14:02 IDT 2024] INFO: org.jboss.weld.event.ExtensionObserverMethodImpl checkRequiredTypeAnnotations - WELD-000411: Observer method [BackedAnnotatedMethod] private io.helidon.microprofile.openapi.OpenApiCdiExtension.processAnnotatedType(@Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. [Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.tracing.tracerresolver.TracerResolverBuilder build - TracerResolver not configured, tracing is disabled [Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authentication provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). Security will not have any valid authentication provider [Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.security.SecurityCdiExtension registerSecurity - Authorization provider is missing from security configuration, but security extension for microprofile is enabled (requires providers configuration at key security.providers). ABAC provider is configured for authorization. [Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.grpc.server.GrpcServerImpl start - gRPC server [test.server]: listening on port 1111 (TLS=false) [Mon Jun 24 15:14:03 IDT 2024] INFO: io.helidon.microprofile.grpc.server.GrpcServerCdiExtension lambda$startServer$3 - gRPC server started on localhost:1111 (and all other host addresses) in 181 milliseconds.



When running with gradle, grpc services are not listed

Is there any hidden dependency the need to be specified in gradle?