Problem with aspectJ Maven plugin (was: Compiler problem when building with Maven)

View: New views
4 Messages — Rating Filter:   Alert me  

Problem with aspectJ Maven plugin (was: Compiler problem when building with Maven)

by Ichthyostega :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Dave,

just a second before I've found your post to the mojo users list in
the archives.... :)

Dave Whittaker schrieb:
> I think this will do it.  I haven't used the Maven AJ plugin for a
> while, but in the past I've used specific dependencies for the plugin
> itself to override the version of the compiler it used.
.....


While we're at this topic, maybe you (or someone else) know how to deal
with the following problem:

We are forced to use the current snapshot version of the plugin, because
we need support for the "hasMember" toggle.
Now, frequently, we're running into the situation that the standard Java
compiler plugin kicks in instead of the aspectj-compiler. Of course,
then the build fails immediately.
In most of the cases, this happens on aspectj:test-compile
(instead of which we suddenly get compiler:testCompile)

Do you think this might be a bug in the current snapshot, or has anyone
experienced similar behaviour on the release versions? Unfortionately
we have no way to try this out on a realistic setup (because of
"XhasMember") -- and a simple dummy project doesn't reproduce this.

Maybe there is a better place where we could ask such questions?
Any ideas?


and thanks for the hint with the aspecttools-jar version...

Hermann V.
_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: Problem with aspectJ Maven plugin (was: Compiler problem when building with Maven)

by Dave Whittaker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hermann,

If I remember correctly it was similar problems that led me to abandon  
using Maven for the compile step altogether.  If I'm remembering right  
it is actually impossible to tell Maven not to build what is included  
in src/main/java, what you end up doing when adding the AJ plugin is  
just having that compile step occur first and then running a  
completely redundant one afterwards.   So what I ended up doing is  
moving all of my source to src/main/aspectj and then configuring the  
AJ plugin accordingly... unfortunately I can't remember how to do that  
off the top of my head.  At this point I've taken it a step further  
and I let Eclipse compile my Java/AJ code directly to target/classes  
and since Maven ignores the src/main/aspectj folder it both speeds up  
my builds greatly and allows me to upgrade AJ as necessary by just  
grabbing the latest version of AJDT.  Of course you can't build  
outside of Eclipse that way, so if you are doing any type of  
continuous integration or other external build process it might not be  
appropriate for you.

On Nov 10, 2009, at 1:00 PM, prg@... wrote:

>
> Hi Dave,
>
> just a second before I've found your post to the mojo users list in
> the archives.... :)
>
> Dave Whittaker schrieb:
>> I think this will do it.  I haven't used the Maven AJ plugin for a
>> while, but in the past I've used specific dependencies for the plugin
>> itself to override the version of the compiler it used.
> .....
>
>
> While we're at this topic, maybe you (or someone else) know how to  
> deal
> with the following problem:
>
> We are forced to use the current snapshot version of the plugin,  
> because
> we need support for the "hasMember" toggle.
> Now, frequently, we're running into the situation that the standard  
> Java
> compiler plugin kicks in instead of the aspectj-compiler. Of course,
> then the build fails immediately.
> In most of the cases, this happens on aspectj:test-compile
> (instead of which we suddenly get compiler:testCompile)
>
> Do you think this might be a bug in the current snapshot, or has  
> anyone
> experienced similar behaviour on the release versions? Unfortionately
> we have no way to try this out on a realistic setup (because of
> "XhasMember") -- and a simple dummy project doesn't reproduce this.
>
> Maybe there is a better place where we could ask such questions?
> Any ideas?
>
>
> and thanks for the hint with the aspecttools-jar version...
>
> Hermann V.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@...
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Parent Message unknown Re: Problem with aspectJ Maven plugin (was: Compiler problem when building with Maven)

by Ichthyostega :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dave,

thanks for your explanations. Basically our own findings support the
same view: the way the aspectj-maven plugin "pushes aside" the standard
java compiler plugin seems a bit hackish. Maybe Maven is lacking a
clear mechanism how to achieve such?

Anyway, my colleague Maxim Minin did come up with a similarly clever
hack to defeat the bad plain flat java compiler:

In our "master" POM.....

 <pluginManagement>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>

        <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <testExcludes>
                <exclude>**/*.java</exclude>
                <exclude>**/*.aj</exclude>
            </testExcludes>
        </configuration>
    </plugin>
...

Thus the standard compiler will just not "see" any source files
anymore. This way he is free to compile whenever he feels like it
:-D
and doesn't interfere with the AspectJ compile anymore...



Dave Whittaker schrieb:
> At this point I've taken it a step further and I let Eclipse compile
> my Java/AJ code directly.... Of course you can't build outside of
> Eclipse that way, so if you are doing any type of continuous
> integration or other external build process it might not be
> appropriate for you.
yeah, exactly that's the problem for us. Basically this simple building
within the IDE and even by a compound of ANT scripts gets more and more
unmanageable. Thus we're more or less forced to build up something like
a Maven build, especially because in our environment (banking) there are
additional requirements of reproducibility of the artefacts creation.

Cheers,
Hermann
_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: Re: Problem with aspectJ Maven plugin (was: Compiler problem when building with Maven)

by Olle Hallin-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have a look at http://maven.apache.org/plugins/maven-compiler-plugin/non-javac-compilers.html .

Perhaps it can help.

Regards,
Olle Hallin

Senior Java Developer and Architect
olle.hallin@...
www.crisp.se
http://www.linkedin.com/in/ollehallin


2009/11/10 prg@... <prg@...>

Dave,

thanks for your explanations. Basically our own findings support the
same view: the way the aspectj-maven plugin "pushes aside" the standard
java compiler plugin seems a bit hackish. Maybe Maven is lacking a
clear mechanism how to achieve such?

Anyway, my colleague Maxim Minin did come up with a similarly clever
hack to defeat the bad plain flat java compiler:

In our "master" POM.....

 <pluginManagement>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>

        <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <testExcludes>
                <exclude>**/*.java</exclude>
                <exclude>**/*.aj</exclude>
            </testExcludes>
        </configuration>
    </plugin>
...

Thus the standard compiler will just not "see" any source files
anymore. This way he is free to compile whenever he feels like it
:-D
and doesn't interfere with the AspectJ compile anymore...



Dave Whittaker schrieb:
> At this point I've taken it a step further and I let Eclipse compile
> my Java/AJ code directly.... Of course you can't build outside of
> Eclipse that way, so if you are doing any type of continuous
> integration or other external build process it might not be
> appropriate for you.
yeah, exactly that's the problem for us. Basically this simple building
within the IDE and even by a compound of ANT scripts gets more and more
unmanageable. Thus we're more or less forced to build up something like
a Maven build, especially because in our environment (banking) there are
additional requirements of reproducibility of the artefacts creation.

Cheers,
Hermann
_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users