jte-jspecify-nullmarked NullMarked Annotation Generator¶
jte-jspecify-nullmarked is a generator extension for jte that creates package-info.java files annotated
with @NullMarked for each package containing generated classes. This enables null-safety tooling
(such as NullAway or ErrorProne) to treat generated classes as null-safe, preventing build failures
in projects that enforce null-safety annotations.
Setup¶
Add jspecify 1.0.0 or later to your project dependencies, then configure the build plugin to use the extension.
Add to your <dependencies> section:
Add to your <build><plugins> section:
Run the build to generate classes.
Output¶
For each package containing generated classes, a package-info.java file is created:
If a package-info.java already exists in a package directory, it is left unchanged.