Why do I get a not exposed to the weaver warnings when making my Spring project?

前端 未结 2 1971
慢半拍i
慢半拍i 2021-02-20 14:38

I seem to get a bunch of warnings like this when I make my Spring project. The project uses Compile Time Weaving and various Spring annotations like Transactional, Autowired, an

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-20 15:34

    I had a similar problem. On closer inspection, I realized that the warnings were happening during the test-compile phase only, where aspectj was not smart enough to automatically look in the main java source directory as well as in the test source directory. I solved it by splitting the two goals into separate executions, with different configurations. The relevant part of the POM is given below:

            
            org.codehaus.mojo
            aspectj-maven-plugin
            1.10
            
              1.8
              
                
                    org.springframework
                    spring-aspects
                
              
              1.8
              1.8  
            
            
              
                compile
                
                  compile
                
              
              
              
                test-compile
                
                    
                        test-compile           
                        
                            ${project.basedir}
                            
                                src/main/java/**/*.java
                                src/test/java/**/*.java
                            
                        
                    
                
            
            
        
    

提交回复
热议问题