Checker Framework, -Xlint:all and JUnit











up vote
0
down vote

favorite












I'm trying to keep a project with a very clean and strict setup from the outset, including:




  1. Use of the Checker Framework.

  2. Enabling all compiler warnings and treat them as errors (-Xlint:all and -Werror).

  3. Use of JUnit.


Here are the relevant parts from Maven's pom.xml:



<dependencies>
<!-- Annotations: nullness, etc -->
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>${checkerframework.version}</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>jdk8</artifactId>
<version>${checkerframework.version}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>${checkerframework.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<!-- Add all the checkers you want to enable here -->
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker
</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-Xbootclasspath/p:${annotatedJdk}</arg>
<arg>-Xlint:all</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
</plugins>
</pluginManagement>
</build>


Unfortunately, as soon as I introduce a test class that uses the @Test annotation, I get the following compilation warning and thus a build error:




Warning:java: No processor claimed any of these annotations: org.junit.jupiter.api.Test




How can this warning be avoided?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm trying to keep a project with a very clean and strict setup from the outset, including:




    1. Use of the Checker Framework.

    2. Enabling all compiler warnings and treat them as errors (-Xlint:all and -Werror).

    3. Use of JUnit.


    Here are the relevant parts from Maven's pom.xml:



    <dependencies>
    <!-- Annotations: nullness, etc -->
    <dependency>
    <groupId>org.checkerframework</groupId>
    <artifactId>checker-qual</artifactId>
    <version>${checkerframework.version}</version>
    </dependency>
    <dependency>
    <groupId>org.checkerframework</groupId>
    <artifactId>jdk8</artifactId>
    <version>${checkerframework.version}</version>
    </dependency>

    <dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>${junit.jupiter.version}</version>
    <scope>test</scope>
    </dependency>
    </dependencies>
    <build>
    <pluginManagement>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
    <annotationProcessorPaths>
    <path>
    <groupId>org.checkerframework</groupId>
    <artifactId>checker</artifactId>
    <version>${checkerframework.version}</version>
    </path>
    </annotationProcessorPaths>
    <annotationProcessors>
    <!-- Add all the checkers you want to enable here -->
    <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker
    </annotationProcessor>
    </annotationProcessors>
    <compilerArgs>
    <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
    <arg>-Xlint:all</arg>
    <arg>-Werror</arg>
    </compilerArgs>
    </configuration>
    </plugin>
    <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M1</version>
    </plugin>
    </plugins>
    </pluginManagement>
    </build>


    Unfortunately, as soon as I introduce a test class that uses the @Test annotation, I get the following compilation warning and thus a build error:




    Warning:java: No processor claimed any of these annotations: org.junit.jupiter.api.Test




    How can this warning be avoided?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to keep a project with a very clean and strict setup from the outset, including:




      1. Use of the Checker Framework.

      2. Enabling all compiler warnings and treat them as errors (-Xlint:all and -Werror).

      3. Use of JUnit.


      Here are the relevant parts from Maven's pom.xml:



      <dependencies>
      <!-- Annotations: nullness, etc -->
      <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
      <version>${checkerframework.version}</version>
      </dependency>
      <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>jdk8</artifactId>
      <version>${checkerframework.version}</version>
      </dependency>

      <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
      </dependency>
      </dependencies>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.0</version>
      <configuration>
      <annotationProcessorPaths>
      <path>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker</artifactId>
      <version>${checkerframework.version}</version>
      </path>
      </annotationProcessorPaths>
      <annotationProcessors>
      <!-- Add all the checkers you want to enable here -->
      <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker
      </annotationProcessor>
      </annotationProcessors>
      <compilerArgs>
      <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
      <arg>-Xlint:all</arg>
      <arg>-Werror</arg>
      </compilerArgs>
      </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>3.0.0-M1</version>
      </plugin>
      </plugins>
      </pluginManagement>
      </build>


      Unfortunately, as soon as I introduce a test class that uses the @Test annotation, I get the following compilation warning and thus a build error:




      Warning:java: No processor claimed any of these annotations: org.junit.jupiter.api.Test




      How can this warning be avoided?










      share|improve this question













      I'm trying to keep a project with a very clean and strict setup from the outset, including:




      1. Use of the Checker Framework.

      2. Enabling all compiler warnings and treat them as errors (-Xlint:all and -Werror).

      3. Use of JUnit.


      Here are the relevant parts from Maven's pom.xml:



      <dependencies>
      <!-- Annotations: nullness, etc -->
      <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
      <version>${checkerframework.version}</version>
      </dependency>
      <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>jdk8</artifactId>
      <version>${checkerframework.version}</version>
      </dependency>

      <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
      </dependency>
      </dependencies>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.0</version>
      <configuration>
      <annotationProcessorPaths>
      <path>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker</artifactId>
      <version>${checkerframework.version}</version>
      </path>
      </annotationProcessorPaths>
      <annotationProcessors>
      <!-- Add all the checkers you want to enable here -->
      <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker
      </annotationProcessor>
      </annotationProcessors>
      <compilerArgs>
      <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
      <arg>-Xlint:all</arg>
      <arg>-Werror</arg>
      </compilerArgs>
      </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>3.0.0-M1</version>
      </plugin>
      </plugins>
      </pluginManagement>
      </build>


      Unfortunately, as soon as I introduce a test class that uses the @Test annotation, I get the following compilation warning and thus a build error:




      Warning:java: No processor claimed any of these annotations: org.junit.jupiter.api.Test




      How can this warning be avoided?







      java maven junit checker-framework






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 4:49









      Paulo

      492414




      492414
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Found a solution: this specific warning can be silenced with -Xlint:-processing:



          <build>
          <pluginManagement>
          <plugins>
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
          ...
          <compilerArgs>
          <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
          <arg>-Xlint:all</arg>
          <!-- Silence warning "No processor claimed any of these annotations". One of the
          annotations that would trigger it is org.junit.jupiter.api.Test -->
          <arg>-Xlint:-processing</arg>
          <arg>-Werror</arg>
          </compilerArgs>
          </configuration>
          </plugin>
          </plugins>
          </pluginManagement>
          </build>





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245938%2fchecker-framework-xlintall-and-junit%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Found a solution: this specific warning can be silenced with -Xlint:-processing:



            <build>
            <pluginManagement>
            <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
            ...
            <compilerArgs>
            <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
            <arg>-Xlint:all</arg>
            <!-- Silence warning "No processor claimed any of these annotations". One of the
            annotations that would trigger it is org.junit.jupiter.api.Test -->
            <arg>-Xlint:-processing</arg>
            <arg>-Werror</arg>
            </compilerArgs>
            </configuration>
            </plugin>
            </plugins>
            </pluginManagement>
            </build>





            share|improve this answer

























              up vote
              0
              down vote













              Found a solution: this specific warning can be silenced with -Xlint:-processing:



              <build>
              <pluginManagement>
              <plugins>
              <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.8.0</version>
              <configuration>
              ...
              <compilerArgs>
              <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
              <arg>-Xlint:all</arg>
              <!-- Silence warning "No processor claimed any of these annotations". One of the
              annotations that would trigger it is org.junit.jupiter.api.Test -->
              <arg>-Xlint:-processing</arg>
              <arg>-Werror</arg>
              </compilerArgs>
              </configuration>
              </plugin>
              </plugins>
              </pluginManagement>
              </build>





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Found a solution: this specific warning can be silenced with -Xlint:-processing:



                <build>
                <pluginManagement>
                <plugins>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                ...
                <compilerArgs>
                <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
                <arg>-Xlint:all</arg>
                <!-- Silence warning "No processor claimed any of these annotations". One of the
                annotations that would trigger it is org.junit.jupiter.api.Test -->
                <arg>-Xlint:-processing</arg>
                <arg>-Werror</arg>
                </compilerArgs>
                </configuration>
                </plugin>
                </plugins>
                </pluginManagement>
                </build>





                share|improve this answer












                Found a solution: this specific warning can be silenced with -Xlint:-processing:



                <build>
                <pluginManagement>
                <plugins>
                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                ...
                <compilerArgs>
                <arg>-Xbootclasspath/p:${annotatedJdk}</arg>
                <arg>-Xlint:all</arg>
                <!-- Silence warning "No processor claimed any of these annotations". One of the
                annotations that would trigger it is org.junit.jupiter.api.Test -->
                <arg>-Xlint:-processing</arg>
                <arg>-Werror</arg>
                </compilerArgs>
                </configuration>
                </plugin>
                </plugins>
                </pluginManagement>
                </build>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 at 4:52









                Paulo

                492414




                492414






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245938%2fchecker-framework-xlintall-and-junit%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    List item for chat from Array inside array React Native

                    Thiostrepton

                    Caerphilly