[ 
https://issues.apache.org/jira/browse/MCOMPILER-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16406281#comment-16406281
 ] 

Alexander Kriegisch edited comment on MCOMPILER-194 at 3/20/18 1:07 PM:
------------------------------------------------------------------------

Update because [~aclement] asked my via e-mail if he should trigger some 
changes in AspectJ Maven (even though he is actually not the maintainer there). 
I suggested to build the current snapshot of Maven Compiler Plugin on my own 
box and check if the patch (cannot add link because Jira messes up the URL) 
attached to MCOMPILER-209 fixes the problem. It does, at least symptomatically. 
That means:
 * When using {{<useIncrementalCompilation>true</useIncrementalCompilation>}} 
or just nothing (default), incremental compilation works as expected
 * When switching to {{false}}, compilation in my AspectJ project breaks 
because Maven Compiler thinks it needs to recompile one file, which is also to 
be expected.

*Attention:* While this fixes the problems with AspectJ Maven in combination 
with Maven Compiler, I do not know whether it fixes the root cause or is merely 
a symptomatic fix and should actually be addressed in another way or maybe even 
in AspectJ Maven. What I can say is that with Maven Compiler 2.5.1 my sample 
project works, as of 3.0 it stops working. Probably incremental compilation was 
introduced in 3.0, I did not check though. The 
[commit|https://github.com/apache/maven-compiler-plugin/commit/82aabadbad6b8cda637bf4fc4959cb7028fd00c6]
 by [~olamy] to make it configurable via a switch which is modified by the 
patch mentioned above was introduced later, though, i.e. for version 3.1.

So what does that mean to you experts here? [~aclement], [~oliver.gierke], did 
incremental compilation as such break interoperability with AspectJ Maven to 
begin with or is there a problem in the way it was implemented here or there? 
You have the facts now, please draw your conclusions.


was (Author: kriegaex):
Update because [~aclement] asked my via e-mail if he should trigger some 
changes in AspectJ Maven (even though he is actually not the maintainer there). 
I suggested to build the current snapshot of Maven Compiler Plugin on my own 
box and check if the patch attached to MCOMPILER-209 (cannot add link because 
Jira messes up the URL) fixes the problem. It does, at least symptomatically. 
That means:
 * When using {{<useIncrementalCompilation>true</useIncrementalCompilation>}} 
or just nothing (default), incremental compilation works as expected
 * When switching to {{false}}, compilation in my AspectJ project breaks 
because Maven Compiler thinks it needs to recompile one file, which is also to 
be expected.

*Attention:* While this fixes the problems with AspectJ Maven in combination 
with Maven Compiler, I do not know whether it fixes the root cause or is merely 
a symptomatic fix and should actually be addressed in another way or maybe even 
in AspectJ Maven. What I can say is that with Maven Compiler 2.5.1 my sample 
project works, as of 3.0 it stops working. Probably incremental compilation was 
introduced in 3.0, I did not check though. The 
[commit|https://github.com/apache/maven-compiler-plugin/commit/82aabadbad6b8cda637bf4fc4959cb7028fd00c6]
 by [~olamy] to make it configurable via a switch which is modified by the 
patch mentioned above was introduced later, though, i.e. for version 3.1.

So what does that mean to you experts here? [~aclement], [~oliver.gierke], did 
incremental compilation as such break interoperability with AspectJ Maven to 
begin with or is there a problem in the way it was implemented here or there? 
You have the facts now, please draw your conclusions.

> Strange effects with springs @Configurable (AspectJ) and new compiler plugin 
> version 3.0
> ----------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-194
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-194
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: jdk 1.6.0_38, jdk 1.6.0_37
>            Reporter: Andreas Höhmann
>            Assignee: Michael Osipov
>            Priority: Blocker
>         Attachments: MCOMPILER-194.zip, SO_AJ_MavenSoftExceptions.zip
>
>
> I have no details I can only report the "effects" ..
> I have a maven project with compiler-plugin 2.5.1,
> aspectj-plugin 1.4, java 1.6 and a lot of @Configurable 
> annotations in my code. Aspectj will decorate these classes
> so @Autowired dependencies injected during runtime. 
> All is working fine.
> Now I switch to compiler-plugin 3.0 ... nothing else changed!
> Then "sometimes" I got NPE's because the injected service etc. are
> not available. I guess aspectj was not successfull. I have no
> errors etc. anywhere during build.
> Strang :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to