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

后端 未结 4 907
忘掉有多难
忘掉有多难 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:53

    The pom file information is spot on. I had the additional challenge of building someone else's Maven project in Jenkins and not having access to the pom file repository.

    I created a pre-build step to insert the compiler parameter into the pom file after downloading it from git, for example

    sed -i 's|/target> *$|/target>\n\n-Xlint:deprecation\n|' $WORKSPACE/pom.xml
    

提交回复
热议问题