-
Notifications
You must be signed in to change notification settings - Fork 322
Description
Apache Maven's plugin API runs on top of Plexus and Google Guice via Eclipse Sisu to provide dependency injection.
The org.apache.maven.plugins.annotations.Parameter annotation is a special annotation that shares some semantics with javax.inject.Inject, in that it will be populated by dependency injection.
Whilst more complex configuration could be provided, at a bare minimum, it is safe to assume that anything annotated with this should be treated as being dynamically initialized if and only if the outer class implements Mojo (or extends a class implementing that interface, such as AbstractMojo).
A rough workaround right now is to specify the class in -XepOpt:NullAway:ExcludedFieldAnnotations=org.apache.maven.plugins.annotations.Parameter, but it would be nice for potential first-class support as described above, as it will allow encouraging the use of null-safety annotations within Maven plugins correctly, which in turn will encourage the development of more robust build tooling in the Java community.