]> source.dussan.org Git - jgit.git/commitdiff
Enable error-prone for the Maven build 29/85729/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 18 Nov 2016 01:30:27 +0000 (17:30 -0800)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 24 Nov 2016 23:45:14 +0000 (00:45 +0100)
- update maven-compiler-plugin to 3.6.0
- exclude InsecureCipherFactory from errorprone checks

See
https://maven.apache.org/guides/mini/guide-default-execution-ids.html#Example:_Configuring_compile_to_run_twice
https://groups.google.com/d/topic/error-prone-discuss/pzT45ZMCQOc/discussion

Change-Id: Ic16d3f15cf2ef40de62fe6bfe4b8b35f0c1edc4e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
pom.xml

diff --git a/pom.xml b/pom.xml
index 9aceba18ce0563164368e11755af51ff1de2c51d..3c583f4919f030d77960a6968db5eb2966d125e0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.5.1</version>
+          <version>3.6.0</version>
           <configuration>
             <encoding>UTF-8</encoding>
             <source>1.8</source>
             <target>1.8</target>
           </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>2.8.1</version>
+            </dependency>
+            <dependency>
+              <groupId>org.codehaus.plexus</groupId>
+              <artifactId>plexus-compiler-javac-errorprone</artifactId>
+              <version>2.8.1</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.0.14</version>
+            </dependency>
+          </dependencies>
         </plugin>
 
         <plugin>