summaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-12-27 02:11:47 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2021-02-27 21:00:30 +0100
commitb126372448958d7b6dee1ca0ad70ec4fbb52899f (patch)
tree1c2df71cc9e138e300d658497b670d0788cfadc7 /pom.xml
parent789c0479a9294417db0375cce9f1949fe9052d8c (diff)
downloadjgit-b126372448958d7b6dee1ca0ad70ec4fbb52899f.tar.gz
jgit-b126372448958d7b6dee1ca0ad70ec4fbb52899f.zip
Fix errorprone configuration for maven-compiler-plugin with javac
See https://errorprone.info/docs/installation. Add new profile jdk8 to enable running errorprone with javac on java 8 and java 11. Remove errorprone configuration from benchmark module, didn't find a way to make it work and this module does not contain any productive code. Change-Id: I6a84195af05e6cea9e7c04ad5cd4c79742e80cb3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml81
1 files changed, 34 insertions, 47 deletions
diff --git a/pom.xml b/pom.xml
index e7d35ff8c9..4846aff54b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -814,54 +814,41 @@
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
+ <compilerArgs>
+ <arg>-XDcompilePolicy=simple</arg>
+ <arg>-Xplugin:ErrorProne</arg>
+ </compilerArgs>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>com.google.errorprone</groupId>
+ <artifactId>error_prone_core</artifactId>
+ <version>2.4.0</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk8</id>
+ <activation>
+ <jdk>1.8</jdk>
+ </activation>
+ <properties>
+ <javac.version>9+181-r4173-1</javac.version>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs combine.children="append">
+ <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg>
+ </compilerArgs>
</configuration>
- <executions>
- <execution>
- <id>default-compile</id>
- <phase>compile</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <includes>
- <include>org/eclipse/jgit/transport/InsecureCipherFactory.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>compile-with-errorprone</id>
- <phase>compile</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <compilerId>javac-with-errorprone</compilerId>
- <forceJavacCompilerUse>true</forceJavacCompilerUse>
- <excludes>
- <exclude>org/eclipse/jgit/transport/InsecureCipherFactory.java</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-javac</artifactId>
- <version>${plexus-compiler-version}</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-javac-errorprone</artifactId>
- <version>${plexus-compiler-version}</version>
- </dependency>
- <!-- override plexus-compiler-javac-errorprone's dependency on
- Error Prone with the latest version -->
- <dependency>
- <groupId>com.google.errorprone</groupId>
- <artifactId>error_prone_core</artifactId>
- <version>2.3.4</version>
- </dependency>
- </dependencies>
</plugin>
</plugins>
</build>