On Sun, 01 Mar 2015 02:40:40 +0100, Eric B <
eben...@gmail.com> wrote:
> A lot depends on what you use aspectj to do. If you are just advising
> methods etc it won't be a problem. The issue occurs when you try to
> declare fields and /or methods in a mixin aspect. In which case the
> javac
> compiler fails b/c the fields don't exist (assuming they are referenced)
> and the ajc compiler falls b/c none of the Lombok generated code exists.
>
> So you can't run delomok or anything else at that point b/c you have a
> deadlock / catch 22 situation, where ajc needs the Lombok code to compile
> and javac needs the aspectj code to compile.
>
> LTW would work since at that point Lombok code is just regularly
> generated
> Java.
If you aren't doing extensive stuff such as the quoted injection of
fields/methods (that are referred by Lombok in some way), it's also
perfectly possible to have Lombok to co-exist with ajc even with static
weaving. I'm routinely doing that. All you need is to force ajc to
manipulate bytecode (which happens when you de-configure the source
directory, so ajc can't find them and reverts to bytecode). Below an
excerpt of my POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<Xlint>ignore</Xlint>
<source>${tft.javac.source}</source>
<complianceLevel>${tft.javac.source}</complianceLevel>
<target>${tft.javac.target}</target>
<!-- Prevent ajc from finding sources -->
<sources />
<testSources />
<!-- This is important because sometimes the
plugin decides that there's nothing to do
because sources are not specified -->
<forceAjcCompile>true</forceAjcCompile>
...
</configuration>
...
</plugin>
--
Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
"We make Java work. Everywhere."
http://tidalwave.it/fabrizio/blog -
fabrizio...@tidalwave.it