From 894bfe1c083fbe257eef78cbab6860032026d122 Mon Sep 17 00:00:00 2001 From: Mart Hagenaars Date: Thu, 17 Mar 2016 10:17:39 +0100 Subject: Update instructions for using lombok with ecj and Maven --- website/setup/ecj.html | 28 ++++++++++++++++-- website/setup/pom.xml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 website/setup/pom.xml (limited to 'website/setup') diff --git a/website/setup/ecj.html b/website/setup/ecj.html index 07d2f0f6..cc70c566 100644 --- a/website/setup/ecj.html +++ b/website/setup/ecj.html @@ -42,10 +42,34 @@
ecj (the eclipse standalone compiler) is compatible with lombok. Use the following command line to enable lombok with ecj:

-

-java -javaagent:lombok.jar=ECJ -Xbootclasspath/p:lombok.jar -jar ecj.jar -cp lombok.jar (rest of arguments)
+
java -javaagent:lombok.jar=ECJ -jar ecj.jar -cp lombok.jar -source 1.8 (rest of arguments)
+

+ You may have to add the following VM argument, if you're using an older version of lombok or java: +

-Xbootclasspath/p:lombok.jar
+

If you're using a tool based on ecj, adding these VM arguments and adding lombok.jar to the classpath should work.

+
+
+
+

Using ecj with Maven

+

+ It is possible to configure maven-compiler-plugin with maven-dependency-plugin and plexus-compiler-eclipse. +

+

+ Before the compile phase, you will have to set your MAVEN_OPTS environment variable to include the javaagent argument. + In the example below, target is your ${project.build.directory}. +

+

+ Use the following commands in sequence to enable lombok with ecj in your Maven build: +

+mvn clean dependency:copy@get-lombok
+set MAVEN_OPTS=-javaagent:target/lombok.jar=ECJ (or your OS's equivalent)
+mvn install
+set MAVEN_OPTS= (or your OS's equivalent)
+
+

+