| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| <modelVersion>4.0.0</modelVersion> |
| |
| <groupId>org.checkerframework</groupId> |
| <artifactId>MavenExample</artifactId> |
| <version>1.0-SNAPSHOT</version> |
| <packaging>jar</packaging> |
| |
| <name>MavenExample</name> |
| <url>http://maven.apache.org</url> |
| |
| <properties> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <!-- These properties will be set by the Maven Dependency plugin --> |
| <errorProneJavac>${com.google.errorprone:javac:jar}</errorProneJavac> |
| <checkerFrameworkVersion><!-- checker-framework-version -->3.13.0<!-- /checker-framework-version --></checkerFrameworkVersion> |
| </properties> |
| |
| <dependencies> |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <version>4.13.1</version> |
| <scope>test</scope> |
| </dependency> |
| <!-- Annotations from the Checker Framework: nullness, interning, locking, ... --> |
| <dependency> |
| <groupId>org.checkerframework</groupId> |
| <artifactId>checker-qual</artifactId> |
| <version>${checkerFrameworkVersion}</version> |
| </dependency> |
| <dependency> |
| <groupId>com.google.errorprone</groupId> |
| <artifactId>javac</artifactId> |
| <version>9+181-r4173-1</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-lang3</artifactId> |
| <version>3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.4</version> |
| <scope>provided</scope> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <plugins> |
| <plugin> |
| <!-- This plugin will set properties values using dependency information --> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <executions> |
| <execution> |
| <goals> |
| <goal>properties</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-site-plugin</artifactId> |
| <version>3.2</version> |
| </plugin> |
| </plugins> |
| </build> |
| |
| <profiles> |
| <profile> |
| <id>checkerframework</id> |
| <activation> |
| <jdk>[1.8,13)</jdk> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>3.8.1</version> |
| <configuration> |
| <fork>true</fork> <!-- Must fork or else JVM arguments are ignored. --> |
| <compilerArguments> |
| <Xmaxerrs>10000</Xmaxerrs> |
| <Xmaxwarns>10000</Xmaxwarns> |
| </compilerArguments> |
| <annotationProcessorPaths> |
| <path> |
| <groupId>org.checkerframework</groupId> |
| <artifactId>checker</artifactId> |
| <version>3.7.0</version> |
| </path> |
| </annotationProcessorPaths> |
| <annotationProcessors> |
| <!-- Add all the checkers you want to enable here --> |
| <annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor> |
| </annotationProcessors> |
| <compilerArgs> |
| <!-- <arg>-Awarns</arg> --> <!-- -Awarns turns type-checking errors into warnings. --> |
| </compilerArgs> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| <dependencies> |
| <dependency> |
| <groupId>org.checkerframework</groupId> |
| <artifactId>checker</artifactId> |
| <version>${checkerFrameworkVersion}</version> |
| </dependency> |
| </dependencies> |
| </profile> |
| |
| <profile> |
| <id>checkerframework-jdk8</id> |
| <activation> |
| <jdk>1.8</jdk> |
| </activation> |
| <!-- using github.com/google/error-prone-javac is required when running on JDK 8 --> |
| <properties> |
| <javac.version>9+181-r4173-1</javac.version> |
| </properties> |
| <dependencies> |
| <dependency> |
| <groupId>com.google.errorprone</groupId> |
| <artifactId>javac</artifactId> |
| <version>9+181-r4173-1</version> |
| </dependency> |
| </dependencies> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <configuration> |
| <fork>true</fork> <!-- Must fork or else JVM arguments are ignored. --> |
| <source>1.8</source> |
| <target>1.8</target> |
| <compilerArgs combine.children="append"> |
| <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg> |
| </compilerArgs> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| |
| <profile> |
| <id>checkerframework-jdk11</id> |
| <activation> |
| <jdk>11</jdk> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <configuration> |
| <fork>true</fork> |
| <release>11</release> |
| <compilerArgs combine.children="append"> |
| <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> |
| </compilerArgs> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| |
| <reporting> |
| <excludeDefaults>true</excludeDefaults> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-jxr-plugin</artifactId> |
| <version>2.1</version> |
| </plugin> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>findbugs-maven-plugin</artifactId> |
| <version>3.0.3</version> |
| <configuration> |
| <findbugsXmlOutput>true</findbugsXmlOutput> |
| <findbugsXmlWithMessages>true</findbugsXmlWithMessages> |
| <includeTests>true</includeTests> |
| <xmlOutput>true</xmlOutput> |
| </configuration> |
| </plugin> |
| </plugins> |
| </reporting> |
| |
| </project> |