Maven example of annotation preprocessing and generation of classes in same compile process?

后端 未结 3 2080
南方客
南方客 2020-12-13 10:45

Does anyone have a clean example of a maven project preprocessing class annotations at compile time with subsequent generation of classes to be compiled in the same compilat

3条回答
  •  执念已碎
    2020-12-13 11:26

    maven-processor-plugin can do that...

    https://code.google.com/p/maven-annotation-plugin/

    Example from documentation:

     
      
      
        org.bsc.maven
        maven-processor-plugin
        
          
            process
            
              process
            
            generate-sources
          
        
      
      
      
        org.apache.maven.plugins
        maven-compiler-plugin
        
          -proc:none
        
      
     
    

提交回复
热议问题