can not get lombok to work (both with springsource and maven), missing something?

936 views
Skip to first unread message

tchize

unread,
Mar 16, 2011, 11:07:16 AM3/16/11
to Project Lombok
Hello,

am evaluating lombok usage for a projet. I did follow web site
instructions, added
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.9.3</version>
<scope>provided</scope>
</dependency>

to my maven, used lombok.jar to edit my STS.ini that now looks like
this:
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/
org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.200.v20090519
-product
com.springsource.sts.ide
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-javaagent:/home/...../springsource/sts-2.3.2.RELEASE/lombok.jar
-Xbootclasspath/a:/home/...../springsource/sts-2.3.2.RELEASE/
lombok.jar


and restarted eclipse. I then created to simple classes:
@Data
public class TestB {
private int x;
private String y;
}
public class TestA {

public void doTest(TestB b){
b.getX();
}
}

Eclipse provides mes with auto completion, where i see that TestB has
get/setX, get/setY, toString, equals and hashcode defined in TestB.
However, it underlines b.getX(); and says "The method getX() is
undefined for the type testB. When i run with maven package i get this
output:


[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Product Sender Daemon 0.1-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.1:resources (default-resources)
@ productsSender-sender ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 19 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @
productsSender-sender ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- aspectj-maven-plugin:1.3:compile (default) @ productsSender-
sender ---
[ERROR] The method getX() is undefined for the type TestB
[WARNING] advice defined in
org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has
not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in
org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl
has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in
org.springframework.mock.staticmock.AbstractMethodMockingControl has
not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in
org.springframework.mock.staticmock.AbstractMethodMockingControl has
not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in
org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect
has not been applied [Xlint:adviceDidNotMatch]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 8.031s
[INFO] Finished at: Wed Mar 16 15:46:46 CET 2011
[INFO] Final Memory: 10M/235M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:
1.3:compile (default) on project productsSender-sender: Compiler
errors:
error at b.getX();
^
/home/delbd/dev/workspace-Psender/
be.meteo.products.tool.productsSender-all/sender/src/main/java/
TestA.java:5:0::0 The method getX() is undefined for the type TestB
-> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

tchize

unread,
Mar 17, 2011, 10:18:38 AM3/17/11
to Project Lombok
According to some docs i found online, it seems people have trouble
using lombok with aspectJ load time weaving. Can people confirm there
is no way to get these tools to work together? We can not afford to
remove aspectj from our application. Or is there a way to tell maven
aspectj compiler to use lombok too?

tchize

unread,
Mar 17, 2011, 10:19:25 AM3/17/11
to Project Lombok
I meant "compile time weaving", sorry ;)

Reinier Zwitserloot

unread,
Mar 17, 2011, 9:44:57 PM3/17/11
to project...@googlegroups.com
We've got a bunch of aspectj related issues in the issue tracker. None of us use AspectJ so it's a mix of not-our-itch and sheer inexperience with AspectJ to get started on looking into it.

tchize

unread,
Mar 18, 2011, 3:05:44 PM3/18/11
to Project Lombok
Am not sure it's really apsectj related. It's more related to how to
use lombok, which does alter compilation process, with other tools
that also alter compilation process. Looks here like aspectj is not
using what ever way lombok is using to interfer with compiler (found
no docs on this).
Reply all
Reply to author
Forward
0 new messages