How to compile using -Xlint:unchecked in a Maven project?

后端 未结 4 905
忘掉有多难
忘掉有多难 2020-12-03 04:29

In NetBeans 7.2, I\'m having trouble finding how to compile using -Xlint:unchecked in a Maven project. Under an Ant project, you can change compiler flags by going to Projec

4条回答
  •  抹茶落季
    2020-12-03 04:50

    I want to elaborate on @Nishant's answer. The compilerArgument tag needs to go inside plugin/configuration tag. Here is a full example:

    
      
        org.apache.maven.plugins
        maven-compiler-plugin
        3.3
        
          1.8
          1.8
          1.8
          1.8
          -Xlint:unchecked
        
      
    
    

提交回复
热议问题