Skip to content
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

protobuf怎么才能支持jakarta呢 #857

Closed
shuigedeng opened this issue Mar 9, 2023 · 2 comments
Closed

protobuf怎么才能支持jakarta呢 #857

shuigedeng opened this issue Mar 9, 2023 · 2 comments
Labels
feedback required Information are missing or feedback for suggestions is requested question A question about this library or its usage

Comments

@shuigedeng
Copy link

springboot: 3.0.4
gradle: 8.0.1
jdk: 17

配置文件如下:
apply plugin: "com.google.protobuf"
dependencies {
api "io.grpc:grpc-netty:1.53.0"
api "io.grpc:grpc-protobuf:1.53.0"
api "io.grpc:grpc-stub:1.53.0"
api "io.grpc:grpc-services:1.53.0"
api "io.grpc:grpc-api:1.53.0"
api "io.grpc:grpc-context:1.53.0"
api "io.grpc:grpc-core:1.53.0"
api "io.netty:netty-common:4.1.89.Final"

//  1.3.5  Java 9+ compatibility - Do NOT update to 2.0.0
implementation 'jakarta.annotation:jakarta.annotation-api:1.3.5'

}

protobuf {
//指定protoc编译器位置 在 protoc 模块下,可以指定多个配置,但是会以最后一个配置为准。
protoc {
//直接使用Maven Central上已经编译好的protoc编译器,
artifact = "com.google.protobuf:protoc:3.19.1"
//指定本地已经安装的protoc编译器
//path = '/usr/local/bin/protoc'
}
//generatedFilesBaseDir = "$projectDir/src/generated"
clean {
delete generatedFilesBaseDir
}
//指定protoc运行插件
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:1.53.0"
}
//javalite {
// // The codegen for lite comes as a separate artifact
// artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.1'
//}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}

最终生成的结果:
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.53.0)",
comments = "Source: Test.proto")
@io.grpc.stub.annotations.GrpcGenerated

请问一下怎么才生成 @jakarta.annotation.Generated 呢

@shuigedeng shuigedeng added the question A question about this library or its usage label Mar 9, 2023
@ST-DDT
Copy link
Collaborator

ST-DDT commented Mar 9, 2023

There is nothing we can do there.
Please ask this question in the protobuf repo and link it here.

@ST-DDT ST-DDT added the feedback required Information are missing or feedback for suggestions is requested label Mar 9, 2023
@usimd
Copy link

usimd commented Apr 11, 2023

There is already a lengthy discussion in grpc/grpc-java#9179 on replacing javax.annotation.Generated. As a workaround, try adding javax.annotation:javax.annotation-api to your dependencies.

@ST-DDT ST-DDT closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback required Information are missing or feedback for suggestions is requested question A question about this library or its usage
Projects
None yet
Development

No branches or pull requests

3 participants