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

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

I am trying:

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


        
6条回答
  •  Happy的楠姐
    2020-12-10 11:38

    By using the workaround in this comment in the open jira issue for maven compiler plugin, the build can be failed for compiler warning.

    This works for me:

        
            org.apache.maven.plugins
            maven-compiler-plugin
            2.3.2
            
                javac
                1.6
                1.6
                -Werror
                true
            
    
            
               
                    org.codehaus.plexus
                    plexus-compiler-api
                    1.8.2
                    
                      
                        org.codehaus.plexus
                        plexus-component-api
                      
                    
               
               
                    org.codehaus.plexus
                    plexus-compiler-manager
                    1.8.2
                    
                      
                        org.codehaus.plexus
                        plexus-component-api
                      
                    
               
               
                    org.codehaus.plexus
                    plexus-compiler-javac
                    1.8.2
                    runtime
                    
                      
                            org.codehaus.plexus
                            plexus-component-api
                       
                    
              
           
        
    

提交回复
热议问题