#1525: Document known issue and workaround for lombok plugin in Eclipse - #2300
#1525: Document known issue and workaround for lombok plugin in Eclipse#2300Paras14 wants to merge 8 commits into
Conversation
…/1525-document-lombok-eclipse-issue
JoelAdbu
left a comment
There was a problem hiding this comment.
Looks good to me. The description is clear and explains the current Lombok issue well.
Coverage Report for CI Build 32346559810Coverage increased (+0.004%) to 72.94%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
…nt-lombok-eclipse-issue # Conflicts: # CHANGELOG.adoc
| A Java agent can only be activated with the JVM option `-javaagent` when eclipse is started. | ||
| An eclipse plugin however is installed into an already running eclipse and therefore can never do this. |
There was a problem hiding this comment.
IMHO your rationale is not really correct. This used to work with the lombok eclipse plugin earlier but broke with Eclipse updates. But however, great that you linked the issue so everybody can be pointed there and read more details or even find it fixed some fine day in the future...
| Otherwise you can download it from https://projectlombok.org/download[projectlombok.org]. | ||
| Please use the same version that your project is compiling against to avoid differences between your IDE and your build. | ||
| 2. Open the file `$IDE_HOME/software/eclipse/eclipse.ini` in a text editor. | ||
| 3. Add the following line at the very end of that file or atleast make sure it is placed after the `-vmargs` line since everything before is passed to the eclipse launcher instead of the JVM: | ||
| + | ||
| ``` | ||
| -javaagent:«absolute-path-to-lombok.jar» | ||
| ``` |
There was a problem hiding this comment.
You can even run the lombok JAR file and see a GUI where you can browse to your Eclipse installation and it will automatically fix the ini file for you.
Maybe that process would be easier for end-users. If you are luck, you can just double-click the JAR to launch lombok installer GUI.
This PR fixes #1525
Implemented changes:
Problem,WorkaroundandStatussection to the eclipse chapter oflombok.adocdescribing that the lombok plugin for eclipse installs successfully but never activates.
-javaagent, which aneclipse plugin installed into a running eclipse cannot do) and linked the upstream issue
[BUG] Eclipse plugin not working but manually adding javaagent to eclipse.ini works projectlombok/lombok#3621.
eclipse.iniincluding the side effects(shared across all IDEasy projects using the same eclipse version, lost on eclipse update).
Statussection why we deliberately do not automate this in IDEasy,so the discussion does not have to be repeated in the future.
CHANGELOG.adoc.This is a documentation-only change, no code was touched.
Testing instructions
Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:
Review the rendered documentation of
documentation/lombok.adoc(sectionLombok in Eclipse).To verify the documented workaround, create a small maven project in
$IDE_HOME/workspaces/mainwith thispom.xml:Add a class
com.example.LombokTestannotated with@Slf4jthat callslog.info("test")inmain. E.g.:Note: lombok
1.18.40or newer is required because IDEasy ships JDK 25, and annotationprocessing has to be enabled explicitly via
<proc>full</proc>since javac no longer runsannotation processors by default as of JDK 23.
Run
ide mvn clean compile, the build should succeed.Import the project into eclipse via
ide eclipse- eclipse reportslog cannot be resolvedeven though the lombok plugin is listed under
About Eclipse IDE>Installation Details.This is the reported problem.
Follow the documented workaround and add
-javaagent:«absolute-path-to-lombok.jar»as last line of$IDE_HOME/software/eclipse/eclipse.ini.Restart eclipse via
ide eclipse, then runMaven>Update Project...on the project(Right click on the project directory> Maven>Update Project>check the directory>OK. The compile error should be gone.