You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Oliver Gierke (JIRA)" <ji...@codehaus.org> on 2013/03/07 13:51:52 UTC

[jira] (MCOMPILER-194) Strange effects with springs @Configurable (AspectJ) and new compiler plugin version 3.0

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

Oliver Gierke commented on MCOMPILER-194:
-----------------------------------------

Do the following:

{noformat}
git clone https://github.com/SpringSource/spring-data-jpa
cd spring-data-jpa
mvn clean test
{noformat}

See the compiler plugin working, the AspectJ compiler kicking in afterwards, tests succeed. Now immediately do the following:

{noformat}
mvn test
{noformat}

The log now looks like this:

{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Data JPA 1.4.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-apt-plugin:1.0.4:process (sources) @ spring-data-jpa ---
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ spring-data-jpa ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ spring-data-jpa ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to /Users/olivergierke/Documents/workspace/spring-data-jpa/target/classes
?
[INFO] 
?
[INFO] 
[INFO] --- aspectj-maven-plugin:1.3:compile (default) @ spring-data-jpa ---
[INFO] No modifications found skipping aspectJ compile
{noformat}

So for whatever reason the compiler plugin thinks it needs to recompile sources (which is waste of resources but not a real problem in the first place). But the AspectJ plugin afterwards seems to consider the compiled classes unchanged although they were just recompiled effectively removing the AspectJ added code from the classes.

During the test run the {{AuditingEntityListenerIntegrationTest}} should fail because of this (AspectJ based DI not taking place).
                
> Strange effects with springs @Configurable (AspectJ) and new compiler plugin version 3.0
> ----------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-194
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-194
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: jdk 1.6.0_38, jdk 1.6.0_37
>            Reporter: Andreas Höhmann
>            Priority: Blocker
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira