-
Notifications
You must be signed in to change notification settings - Fork 54
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
@BuildStep
s in an extension processor are considered unused methods
#1095
Comments
The plugin should only mark the method as unused if it's not reachable by the Quarkus build processor |
@gastaldi do you have a small project example of |
@fbricon yes, any Quarkus extension does that, here is an example: https://github.com/quarkiverse/quarkus-prettytime/blob/main/deployment/src/main/java/io/quarkiverse/prettytime/deployment/PrettyTimeProcessor.java
That's the tricky part. If you build the |
Making methods annotated with However, running a build as part of the validation, to check if it's found in a dot file is probably not gonna happen.
|
I think that's a good start.
I agree, and I am not sure what would be the best solution here. Maybe @dmlloyd has any idea? |
I'm late on this (PTO) but Build step methods are contextually part of an extension's deployment module. The deployment module is independent of any particular application. The steps actually used for an application are dependent on the extensions present, the configuration of the application, and the application's content. A build step method may validly rely on an extension that isn't even present for some applications. Since an extension is usable for many applications, it doesn't make sense to make assumptions about the use of a given build step method based on a single application, thus build steps should always be considered used unless it can be proven locally within the extension itself that the step can never run. |
@dmlloyd thanks that was my intuition. BTW do you know of any other Quarkus annotations that, when used, should mark the code as implicitly used? Feel free to use intellij-quarkus to detect that ;-) |
Not offhand, but if I think of any I'll mention them. |
@BuildStep
s in an extension processor are considered unused methods in IJ, which is not trueOriginally posted by @gastaldi in #1094 (comment)
The text was updated successfully, but these errors were encountered: