You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2021/09/07 21:13:00 UTC

[jira] [Commented] (MCOMPILER-453) Support null-analysis configuration in the Maven POM

    [ https://issues.apache.org/jira/browse/MCOMPILER-453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17411500#comment-17411500 ] 

Robert Scholte commented on MCOMPILER-453:
------------------------------------------

I don't understand what these parameters should do, Based on the description you have an idea, so please provide an integrationtest with it.

> Support null-analysis configuration in the Maven POM
> ----------------------------------------------------
>
>                 Key: MCOMPILER-453
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-453
>             Project: Maven Compiler Plugin
>          Issue Type: Wish
>    Affects Versions: 3.8.1
>            Reporter: Jochen Wiedmann
>            Priority: Major
>
> 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.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)