Setup Java 6 annotation processing configuration for eclipse compiler with maven

前端 未结 3 479
囚心锁ツ
囚心锁ツ 2021-01-31 05:59

What\'s the best way to setup the eclipse project compiler configuration for Java 6 annotation processors?

My solution is to setup the org.eclipse.jdt.apt.core.pre

3条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 06:21

    I am using http://code.google.com/p/maven-annotation-plugin/ wich is simpler to configure. You can use it in two ways:

    • generate sources during compilation (configuration below)
    • generate sources "by hand" to src/main/generated and keep them on SCM
           
                org.bsc.maven
                maven-processor-plugin
                
                    
                        process
                        
                            process
                        
                        generate-sources
                        
                            -encoding ${project.build.sourceEncoding}
                        
                    
                
            
    
    
    
           
                org.bsc.maven
                maven-processor-plugin
                
                    
                        process-test
                        
                            process-test
                        
                        generate-test-sources
                        
                            -encoding ${project.build.sourceEncoding}
                        
                    
                
            
    
    
          
                org.apache.maven.plugins
                maven-compiler-plugin
                2.3.1
                
                    1.6
                    1.6
                    ${project.build.sourceEncoding}
                    
                    -proc:none
                
            
    

提交回复
热议问题