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:
- Use of the Checker Framework.
- Enabling all compiler warnings and treat them as errors (
-Xlint:alland-Werror). - 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
add a comment |
up vote
0
down vote
favorite
I'm trying to keep a project with a very clean and strict setup from the outset, including:
- Use of the Checker Framework.
- Enabling all compiler warnings and treat them as errors (
-Xlint:alland-Werror). - 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
add a comment |
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:
- Use of the Checker Framework.
- Enabling all compiler warnings and treat them as errors (
-Xlint:alland-Werror). - 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
I'm trying to keep a project with a very clean and strict setup from the outset, including:
- Use of the Checker Framework.
- Enabling all compiler warnings and treat them as errors (
-Xlint:alland-Werror). - 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
java maven junit checker-framework
asked Nov 11 at 4:49
Paulo
492414
492414
add a comment |
add a comment |
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>
add a comment |
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>
add a comment |
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>
add a comment |
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>
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>
answered Nov 11 at 4:52
Paulo
492414
492414
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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