Why doesn't AspectJ compile-time weaving of Spring's @Configurable work?

后端 未结 4 1502
后悔当初
后悔当初 2020-12-02 13:51

Update 5: I\'ve downloaded the latest Spring ToolsSuite IDE based on the latest Eclipse. When I import my project as a Maven project, Eclipse/STS appears to

4条回答
  •  [愿得一人]
    2020-12-02 14:16

    It works for us on maven using compile time weaving, try adding the following plugins:

    
    org.apache.maven.plugins
    maven-compiler-plugin
    
        1.6
        true
        1.6
        1.6
    
    
    
    
    org.codehaus.mojo
    aspectj-maven-plugin
    
        
            compile
            
                1.6
                1.6
                false
                true
                
                    
                        org.springframework
                        spring-aspects
                    
                
            
            
                compile
            
        
        
            test-compile
            
                1.6
                1.6
                false
                
                    
                        org.springframework
                        spring-aspects
                    
                
            
            
                test-compile
            
        
    
    
        
            org.aspectj
            aspectjweaver
            1.6.4
        
    
    
    

    Its done as two separate execution steps to allow you to add different aspect libraries for unit testing and compilation.

    You'll also need the following dependency added for the spring-aspects library:

        
            org.springframework
            spring-aspects
            compile
        
    

提交回复
热议问题