我正在将 Nullness Checker 从检查器框架集成到我们使用 Maven 构建的 Java 项目中。maven-compiler-plugin
我为插件配置了注释处理器。一切正常,除了我不希望它通过生成的代码运行。
排除对target
目录中的代码或特定 java 包使用这些注释处理器可能会有所帮助,但我不知道该怎么做。
我还尝试为 Nullness Checker 本身查找配置以排除目录或 java 包。我再次找不到任何东西。
这是我的插件配置:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>3.4.0</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
</annotationProcessors>
</configuration>
</plugin>