, . wrokaround.
eclipse plexus-compiler-eclipse, fork, jvm. , jvm, MAVEN_OPTS.
"plexus-compiler-javac", executable. : fork true executable. :
#!/bin/bash
exec java -javaagent:/path/to/lombok.jar -jar /path/to/ecj.jar $@
, ecj , -AJAVAC pom.xml: (-AXXX=XXX javac)
#!/bin/bash
for last; do
:
done
if [ ${last:0:1} == "@" ]; then
file=${last:1}
if [ -f "$file" ]; then
while read line; do
last="$line"
done < "$file"
fi
length=${#last}
length=$((length - 2))
last=${last:1:$length}
fi
if [ ${last:0:8} == "-AJAVAC=" ]; then
exec java ${last:8} $@
else
exec javac $@
fi
pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>set-properties</id>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<fork>true</fork>
<executable>${basedir}/maven-compiler-javac</executable>
<compilerArgument>-AJAVAC=-javaagent:${org.projectlombok:lombok:jar}=ECJ -jar ${org.eclipse.jdt.core.compiler:ecj:jar}</compilerArgument>
</configuration>
</plugin>