Omit @Generated annotation #486
Replies: 1 comment 3 replies
-
Hey I'd be a little reluctant to including plugin-specific defaults for protoc plugins if it can be helped, since this Maven plugin aims to support working with any generic protoc plugins that handle protobuf compiler requests in a standard way, rather than explicitly having hardcoded logic to handle gRPC specifically. You can specify this explicitly though: <configuration>
...
<binaryMavenPlugins>
<binaryMavenPlugin>
<groupId>io.grpc</groupId>
<artifactId>protoc-gen-grpc-java</artifactId>
<version>${grpc.version}</version>
<options>@generated=omit</options>
</binaryMavenPlugin>
</binaryMavenPlugins>
</configuration> Would this be suitable for your use case? My main worry about adding gRPC specific defaults is that I'd need to provide a bunch of logic just to handle this one case, which could be potentially fragile depending on the version of gRPC in use, and it would also increase maintenance burden for each edge case I'd go on to support. You could include the snippet above in a parent POM though, and parameterize the gRPC plugin inclusion with a Maven profile or the |
Beta Was this translation helpful? Give feedback.
-
Hi,
grpc release 1.6.4 introduced a new option
@generated=omit
. This allows to completely remove useless@javax.annotation.Generated
added to all grpc services - https://github.com/grpc/grpc-java/releases/tag/v1.64.0I think this should be the plugin's default behavior since it helps to remove the dependency on an outdated library.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions