My team has recently decided to use javac-with-errorprone
, and Eclipse complains about not being able to map it to the lifecycle. How can I resolve this without telling Eclipse to ignore it as is the "normal" way to deal with missing m2e connectors?
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.0.8</version>
</dependency>
</dependencies>
</plugin>
It appears that in the default life cycle mapping for the maven-compiler-plugin it looks for compilerId being "
javac
", so when you change it to "javac-with-errorprone
" it suddenly doesn't know what to do.The solution is to make a lifecycle mapping, but instead of the usual thing (ignoring the goals), use the same configurator as the mapper did before (
org.eclipse.m2e.jdt.javaConfigurator
).Unfortunately this does not give you error highlighting as Eclipse is still using its special compiler. However, you can rest assured knowing you aren't ignoring the compiler plugin in Eclipse.