How do I get a Java maven build to fail for compiler warnings?

后端 未结 6 545
暖寄归人
暖寄归人 2020-12-10 11:01

I am trying:

        
            org.apache.maven.plugins
            maven-compiler-plugin&l         


        
6条回答
  •  既然无缘
    2020-12-10 11:45

    New in maven-compiler-plugin 3.6.0: the failOnWarning flag. This worked for me:

      
        maven-compiler-plugin
        3.6.0
        
          
            compile
            process-sources
            
              compile
            
            
              -Xlint:-processing
              true
            
          
        
      
    

    Note that I had to exclude the processing lint or otherwise auto-matter's annotations would break the build with cryptic "symbol not found" errors.

提交回复
热议问题