Skip to content

compiler: Default to @generated=omit #12080

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented May 20, 2025

After many years of issue 9179 being open, there's been nothing to show that we need the javax.annotations.Generated annotation. Most tools use file paths and a few check for annotations with "Generated" in the name. ErrorProne has a few that check for javax.annotations.Generated, but only UnnecessarilyFullyQualified looks like it'd be a problem and it is disabled by default. We're not getting any more information, no users have reported issues with @generated=omit, and the existing dependency is annoying users, so just drop it.

Given we will still retain the GrpcGenerated annotation, it seems highly likely things are already okay. Even if there are problems they would probably be addressed by adding a io.grpc.stub.annotations.Generated annotation or small tweaks. In the short-term, (non-Bazel) users can use @generated=javax, but long-term we could consider removing the option assuming we've resolved any outstanding issues.

We will want to update the examples and the README to remove the org.apache.tomcat:annotations-api dependency after the next release.

Fixes #9179

After many years of issue 9179 being open, there's been nothing to show
that we need the javax.annotations.Generated annotation. Most tools use
file paths and a few check for annotations with "Generated" in the name.
ErrorProne has a few that check for javax.annotations.Generated, but
only UnnecessarilyFullyQualified looks like it'd be a problem and it is
disabled by default. We're not getting any more information, no users
have reported issues with `@generated=omit`, and the existing dependency
is annoying users, so just drop it.

Given we will still retain the GrpcGenerated annotation, it seems highly
likely things are already okay. Even if there are problems they would
probably be addressed by adding a io.grpc.stub.annotations.Generated
annotation or small tweaks. In the short-term, (non-Bazel) users can use
`@generated=javax`, but long-term we could consider removing the option
assuming we've resolved any outstanding issues.

We will want to update the examples and the README to remove the
org.apache.tomcat:annotations-api dependency after the next release.

Fixes grpc#9179
@@ -15,12 +15,3 @@ java_library(
artifact("org.codehaus.mojo:animal-sniffer-annotations"),
],
)

# javax.annotation.Generated is not included in the default root modules in 9,
Copy link
Contributor

@kannanjgithub kannanjgithub May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are removing this we should not say in the PR description that bazel users can still use generated="javax" in the short term, right?

Update: (after seeing the boq CL) Or we are saying they can get the javax annotations emitted but should not actually check for its presence in the classpath?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace javax.annotation.Generated with custom gRPC annotation
2 participants