diff --git a/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/NotSpringBeanInterceptor.java b/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/NotSpringBeanInterceptor.java index 53b3d5f9..c3629d60 100644 --- a/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/NotSpringBeanInterceptor.java +++ b/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/NotSpringBeanInterceptor.java @@ -4,9 +4,7 @@ import io.grpc.ServerCall; import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; -import lombok.extern.slf4j.Slf4j; -@Slf4j public class NotSpringBeanInterceptor implements ServerInterceptor { @Override diff --git a/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/SecuredGreeterService.java b/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/SecuredGreeterService.java index 74718381..330ffb40 100644 --- a/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/SecuredGreeterService.java +++ b/grpc-spring-boot-starter-demo/src/main/java/org/lognet/springboot/grpc/demo/SecuredGreeterService.java @@ -4,7 +4,6 @@ import io.grpc.examples.GreeterOuterClass; import io.grpc.examples.SecuredGreeterGrpc; import io.grpc.stub.StreamObserver; -import lombok.extern.slf4j.Slf4j; import org.lognet.springboot.grpc.GRpcService; import org.lognet.springboot.grpc.security.GrpcSecurity; import org.springframework.security.access.annotation.Secured; @@ -13,7 +12,7 @@ import java.util.Optional; -@Slf4j + @GRpcService(interceptors = { LogInterceptor.class }) @Secured("SCOPE_profile") public class SecuredGreeterService extends SecuredGreeterGrpc.SecuredGreeterImplBase{ diff --git a/grpc-spring-boot-starter-gradle-plugin/src/main/resources/grpc-spring-boot.gradle b/grpc-spring-boot-starter-gradle-plugin/src/main/resources/grpc-spring-boot.gradle index f25bf157..fc132e68 100644 --- a/grpc-spring-boot-starter-gradle-plugin/src/main/resources/grpc-spring-boot.gradle +++ b/grpc-spring-boot-starter-gradle-plugin/src/main/resources/grpc-spring-boot.gradle @@ -7,13 +7,16 @@ java.util.Optional.ofNullable(grpcSpringBoot.getGrpcSpringBootStarterVersion().g } } +def grpcDeps = ["grpc-netty-shaded","grpc-netty","grpc-services"] configurations.all { resolutionStrategy.eachDependency { details -> - if ("io.grpc".equalsIgnoreCase(details.requested.group)) { - details.useVersion grpcSpringBoot.grpcVersion.get() + if ("io.grpc".equalsIgnoreCase(details.requested.group) && + grpcDeps.contains(details.requested.name.toLowerCase())) { + details.useVersion grpcSpringBoot.grpcVersion.get() } } + } @@ -42,7 +45,7 @@ protobuf { all().each { task -> task.builtins { java { - + option "annotate_code" } } task.plugins {