Error when invoking lombok from Ecliupse compiler

715 views
Skip to first unread message

Sébastien Tromp

unread,
Jul 5, 2011, 4:43:00 AM7/5/11
to project...@googlegroups.com
Hello,

I have a maven project in Eclipse that uses lombok/delombok.

When I build, from Eclipse, using a maven script (e.g. mvn clean package), everything works fine.

However, when I run directly from Eclipse (say with a clean/build of my project), I have a classpath issue concerning a class that should be present in the tools.jar from the JDK. I have tried adding the tools.jar directly in my project build path, without any success.

The stack trace is:

03/07/11 23:39:44 CEST: Maven Builder: FULL_BUILD   
03/07/11 23:39:44 CEST: [WARN] The POM for com.google.code.gwt-log:gwt-log:jar:3.1.2 is missing, no dependency information available  
03/07/11 23:39:44 CEST: Build errors for fiveorbs; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.projectlombok:maven-lombok-plugin:0.9.3.1:delombok (default) on project fiveorbs: Execution default of goal org.projectlombok:maven-lombok-plugin:0.9.3.1:delombok failed: A required class was missing while executing org.projectlombok:maven-lombok-plugin:0.9.3.1:delombok: com/sun/tools/javac/util/Context  
-----------------------------------------------------
realm
=    plugin>org.projectlombok:maven-lombok-plugin:0.9.3.1
strategy
= org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls
[0] = file:/C:/Users/Daedin/.m2/repository/org/projectlombok/maven-lombok-        plugin/0.9.3.1/maven-lombok-plugin-0.9.3.1.jar
urls
[1] = file:/C:/Program%20Files/Java/jdk1.6.0_26/jre/../lib/tools.jar
urls
[2] = file:/C:/Users/Daedin/.m2/repository/org/projectlombok/lombok/0.9.3/lombok-0.9.3.jar
urls
[3] = file:/C:/Users/Daedin/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

My configuration is as follows:

  • Eclipse 3.6 Helios
  • Maven 2.3
  • JDK 1.6
  • Lombok 0.9.3
  • Delombok maven plugin 0.9.3.1

The part of the pom.xml that contains the declaration of the delombok plugin is as follows:

<plugin>
   
<groupId>org.projectlombok</groupId>
   
<artifactId>maven-lombok-plugin</artifactId>
   
<version>0.9.3.1</version>
   
<executions>
       
<execution>
           
<phase>generate-sources</phase>
           
<goals>
               
<goal>delombok</goal>
           
</goals>
       
</execution>
   
</executions>
   
<dependencies>
       
<dependency>
           
<groupId>sun.jdk</groupId>
           
<artifactId>tools</artifactId>
           
<version>1.6</version>
           
<scope>system</scope>
           
<systemPath>${java.home}/../lib/tools.jar</systemPath>
       
</dependency>
   
</dependencies>
</plugin>

Would you have any idea as to what might be the issue?
Thanks a lot for your help
--
Seb

Sébastien Tromp

unread,
Jul 5, 2011, 2:43:22 PM7/5/11
to project...@googlegroups.com
I have now switched to lombok 0.10.0-RC1 to solve another issue, but the problem still persists.


Regards,
-- 
Seb

2011/7/5 Sébastien Tromp <sebasti...@gmail.com>



--
Seb

Sébastien Tromp

unread,
Jul 6, 2011, 3:24:41 AM7/6/11
to project...@googlegroups.com

2011/7/5 Sébastien Tromp <sebasti...@gmail.com>

I have now switched to lombok 0.10.0-RC1 to solve another issue, but the problem still persists.


To sum up a bit: 
- lombok is properly installed (I can use lombok during development)
- the maven script looks correct (it builds properly with maven)
- but for some reason when my maven project in eclipse compiles, things are falling apart. 

I'll go back to my delomboked project for now; if there is anything missing that I could provide you to help, feel free to ask :)

Thanks for your help,
-- 
Sébastien
Reply all
Reply to author
Forward
0 new messages