apache / apache/maven-compiler-plugin
[MCOMPILER-453] Support null-analysis configuration in the Maven POM
- Dominant language
- Java
- Stars
- 261
- Forks
- 191
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 8
Description
**[Jochen Wiedmann](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jochen@apache.org)** opened **[MCOMPILER-453](https://issues.apache.org/jira/browse/MCOMPILER-453?redirect=false)** and commented
The commons-lang project intends to start using the `@Nullable`, and `@NonNull` annotations,
both as a guidance for static code analysis, and for the purpose of documentation.
Experience shows, that IDE's are already supporting these kind of things. (See, for example, [https://wiki.eclipse.org/JDT_Core/Null_Analysis|[http://example.com].)](http://example.com).%29/]
Ideally, an IDE importing the commons-lang should be able to detect
a) the fact, that the Maven project is using Null Analysis, and
b) It does so using the namespace "javax.annotation" (and not, for example, "edu.umd.cs.findbugs.annotations", or "com.github.spotbugs.annotation).
For that to happen, there are two obvious choices:
1.) We start adding IDE specific configuration files to the project. (Not desirable,
for any number of reasons.)
2.) We teach the IDE's to read this information from the Maven POM. For example,
have the following in the Compile goal:
`@Parameter`(property="compiler:nullAnalysisEnabled", default="false")
private boolean nullAnalysisEnabled;
`@Parameter`(property="compiler:nullAnalysisNullableAnnotation",
default="javax.annotation.Nullable")
private String nullAnalysisNullableAnnotation;
`@Parameter`(property="compiler:nullAnalysisNonNullAnnotation",
default="javax.annotation.NonNull")
private String nullAnalysisNonNullAnnotation;
If we had that, then we could teach the IDE specific Maven adapter (like M2E) to recognize these parameters, and behave accordingly.
**Note:** At least initially, these parameters could very well be no-ops. It is completely sufficient to have them for documentation purposes.
---
**Affects:** 3.8.1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.