|
| 1 | +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" |
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 3 | + <modelVersion>4.0.0</modelVersion> |
| 4 | + <groupId>com.baeldung</groupId> |
| 5 | + <artifactId>checker-plugin</artifactId> |
| 6 | + <packaging>jar</packaging> |
| 7 | + <version>1.0-SNAPSHOT</version> |
| 8 | + <name>checker-plugin</name> |
| 9 | + <url>http://maven.apache.org</url> |
| 10 | + |
| 11 | + <!-- https://checkerframework.org/manual/#maven --> |
| 12 | + |
| 13 | + <properties> |
| 14 | + <!-- These properties will be set by the Maven Dependency plugin --> |
| 15 | + <annotatedJdk>${org.checkerframework:jdk8:jar}</annotatedJdk> |
| 16 | + <!-- Uncomment to use the Type Annotations compiler. --> |
| 17 | + <!-- |
| 18 | + <typeAnnotationsJavac>${org.checkerframework:compiler:jar}</typeAnnotationsJavac> |
| 19 | + --> |
| 20 | + </properties> |
| 21 | + |
| 22 | + <dependencies> |
| 23 | + |
| 24 | + |
| 25 | + <!-- Annotations from the Checker Framework: nullness, interning, locking, ... --> |
| 26 | + <dependency> |
| 27 | + <groupId>org.checkerframework</groupId> |
| 28 | + <artifactId>checker-qual</artifactId> |
| 29 | + <version>2.3.1</version> |
| 30 | + </dependency> |
| 31 | + <dependency> |
| 32 | + <groupId>org.checkerframework</groupId> |
| 33 | + <artifactId>checker</artifactId> |
| 34 | + <version>2.3.1</version> |
| 35 | + </dependency> |
| 36 | + <dependency> |
| 37 | + <groupId>org.checkerframework</groupId> |
| 38 | + <artifactId>jdk8</artifactId> |
| 39 | + <version>2.3.1</version> |
| 40 | + </dependency> |
| 41 | + <!-- The Type Annotations compiler. Uncomment if using annotations in comments. --> |
| 42 | + <dependency> |
| 43 | + <groupId>org.checkerframework</groupId> |
| 44 | + <artifactId>compiler</artifactId> |
| 45 | + <version>2.3.1</version> |
| 46 | + </dependency> |
| 47 | + |
| 48 | + </dependencies> |
| 49 | + |
| 50 | + <build> |
| 51 | + <plugins> |
| 52 | + |
| 53 | + <plugin> |
| 54 | + <!-- This plugin will set properties values using dependency information --> |
| 55 | + <groupId>org.apache.maven.plugins</groupId> |
| 56 | + <artifactId>maven-dependency-plugin</artifactId> |
| 57 | + <executions> |
| 58 | + <execution> |
| 59 | + <goals> |
| 60 | + <!-- |
| 61 | + Goal that sets a property pointing to the artifact file for each project dependency. |
| 62 | + For each dependency (direct and transitive) a project property will be set which |
| 63 | + follows the: |
| 64 | +
|
| 65 | + groupId:artifactId:type:[classifier] |
| 66 | +
|
| 67 | + form and contains the path to the resolved artifact. --> |
| 68 | + <goal>properties</goal> |
| 69 | + </goals> |
| 70 | + </execution> |
| 71 | + </executions> |
| 72 | + </plugin> |
| 73 | + |
| 74 | + <plugin> |
| 75 | + <artifactId>maven-compiler-plugin</artifactId> |
| 76 | + <version>3.6.1</version> |
| 77 | + <configuration> |
| 78 | + <source>1.8</source> |
| 79 | + <target>1.8</target> |
| 80 | + <!-- Uncomment the following line to use the type annotations compiler. --> |
| 81 | + <!-- <fork>true</fork> --> |
| 82 | + <compilerArguments> |
| 83 | + <Xmaxerrs>10000</Xmaxerrs> |
| 84 | + <Xmaxwarns>10000</Xmaxwarns> |
| 85 | + </compilerArguments> |
| 86 | + <annotationProcessors> |
| 87 | + <!-- Add all the checkers you want to enable here --> |
| 88 | + <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor> |
| 89 | + <annotationProcessor>org.checkerframework.checker.interning.InterningChecker</annotationProcessor> |
| 90 | + <annotationProcessor>org.checkerframework.checker.fenum.FenumChecker</annotationProcessor> |
| 91 | + <annotationProcessor>org.checkerframework.checker.formatter.FormatterChecker</annotationProcessor> |
| 92 | + <annotationProcessor>org.checkerframework.checker.regex.RegexChecker</annotationProcessor> |
| 93 | + </annotationProcessors> |
| 94 | + <compilerArgs> |
| 95 | + <arg>-AprintErrorStack</arg> |
| 96 | + |
| 97 | + <!-- location of the annotated JDK, which comes from a Maven dependency --> |
| 98 | + <arg>-Xbootclasspath/p:${annotatedJdk}</arg> |
| 99 | + <!-- |
| 100 | + --> |
| 101 | + |
| 102 | + <!-- Uncomment the following line to use the type annotations compiler. --> |
| 103 | + <!-- |
| 104 | + <arg>-J-Xbootclasspath/p:${typeAnnotationsJavac}</arg> |
| 105 | + --> |
| 106 | + <!-- Uncomment the following line to turn type-checking warnings into errors. --> |
| 107 | + <arg>-Awarns</arg> |
| 108 | + </compilerArgs> |
| 109 | + </configuration> |
| 110 | + </plugin> |
| 111 | + </plugins> |
| 112 | + </build> |
| 113 | + |
| 114 | +</project> |
0 commit comments