From e8e456b519708aca430b998bf69ff3f214628c31 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 25 Apr 2018 03:09:05 +0200 Subject: [PATCH] Use eclipse compiler in Maven build Found instructions for configuring maven-compiler-plugin with ecj in [1]. Verified that ecj run in this way raises build errors when executed on commit d3ef5213. Define profiles "ecj" for using Eclipse compiler and "javac" for using javac including errorprone. By default ecj will be used. use ecj: $ mvn -Pecj clean install use javac: $ mvn -Pjavac clean install TODO: find out how to run ecj with errorprone from Maven. [1] https://stackoverflow.com/questions/33164976/using-eclipse-java-compiler-ecj-in-maven-builds Change-Id: I716b603b57612b953e603387c82fd01eb1b5ca97 Signed-off-by: Matthias Sohn --- pom.xml | 158 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 57 deletions(-) diff --git a/pom.xml b/pom.xml index a76b6cfba..af26c741d 100644 --- a/pom.xml +++ b/pom.xml @@ -266,63 +266,6 @@ - - maven-compiler-plugin - 3.7.0 - - UTF-8 - 1.8 - 1.8 - - - - default-compile - compile - - compile - - - - org/eclipse/jgit/transport/InsecureCipherFactory.java - - - - - compile-with-errorprone - compile - - compile - - - javac-with-errorprone - true - - org/eclipse/jgit/transport/InsecureCipherFactory.java - - - - - - - org.codehaus.plexus - plexus-compiler-javac - 2.8.2 - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.8.4 - - - - com.google.errorprone - error_prone_core - 2.3.1 - - - - maven-clean-plugin 3.0.0 @@ -761,6 +704,107 @@ + + javac + + + + maven-compiler-plugin + 3.7.0 + + UTF-8 + 1.8 + 1.8 + + + + default-compile + compile + + compile + + + + org/eclipse/jgit/transport/InsecureCipherFactory.java + + + + + compile-with-errorprone + compile + + compile + + + javac-with-errorprone + true + + org/eclipse/jgit/transport/InsecureCipherFactory.java + + + + + + + org.codehaus.plexus + plexus-compiler-javac + 2.8.2 + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + 2.8.4 + + + + com.google.errorprone + error_prone_core + 2.3.1 + + + + + + + + ecj + + true + + + + + maven-compiler-plugin + 3.7.0 + + eclipse + UTF-8 + 1.8 + 1.8 + + + ${project.basedir}/.settings/org.eclipse.jdt.core.prefs + + true + true + + + + org.codehaus.plexus + plexus-compiler-eclipse + 2.8.4 + + + org.eclipse.jdt + ecj + 3.13.102 + + + + + + static-checks