I'm still trying to use lombok with Maven Tycho to be able to
automatically build my eclipse RCP projects which are using lombok in
several places.
Because it's not possible to use them together out of the box, I've been
looking at the sources of both to find a way to run a simple build
successfully.
I need to understand how lombok is working inside eclipse. Why is it
registered as agent and not used as simple annotation processor?
If I use it in a RCP project, the project will have a dependency to the
lombok.jar. Therefore it is on the classpath and will be picked up as
annotation processor during build if Java 1.6 is used. Tycho uses the
eclipse batch compiler (org.eclipse.jdt.internal.compiler.batch.Main)
and the
org.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl as
APT ProcessingEnvironment. Using this configuration lombok responds with
"You should not install lombok.jar as an annotation processor in
eclipse. Instead, run lombok.jar as a java application and follow the
instructions."
I tried to use a new ProcessorDescriptor within
lombok.core.AnnotationProcessor to ignore the warning and patch the
ClassLoader similiar to the JavacProcessor. This gives me the "We
believe you may have just stumbled on lombok issue #164." warning issued
in method
lombok.eclipse.handlers.EclipseHandlerUtil.injectMethod(EclipseNode,
AbstractMethodDeclaration) and will totally break the compilation process.
I did also try to use the java agent and bootclasspath paramters, as
used when running eclipse normally. But the eclipse batch compiler does
not recognize these parameters and hence this also won't work.
I'm willing to get this running, because I don't know of any other
options to build my projects at this point. Another idea might be to
use delombok before tycho picks up. I didn't try this yet and don't know
if it will work...
If you like to have a look at it, I can give you a simple Maven based
project which demonstrates the described problems.
Regards,
Rabea
Do you have an issue in the bug tracker regarding this topic, so that I
can register for that to stay up to date with any ongoing work?
Reinier Zwitserloot schrieb:
> --
> You received this message because you are subscribed to the Google
> Groups group for http://projectlombok.org/
>
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to
> project-lombo...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/project-lombok?hl=en
http://code.google.com/p/projectlombok/issues/detail?id=212