Ale*_*ing 53 java netbeans maven
在NetBeans 7.2中,我很难找到如何使用-Xlint进行编译:在Maven项目中未选中.在Ant项目下,您可以通过转到项目属性 - >编译来更改编译器标志,但Maven项目似乎没有任何此类选项.
有没有办法配置IDE使用Maven编译这些标志?
Nis*_*ant 70
我想你可以在你的pom.xml中设置编译器参数.请参阅http://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
<compilerArgument>-Xlint:unchecked</compilerArgument>
Run Code Online (Sandbox Code Playgroud)
Raj*_*ajV 42
我想详细说明@Nishant的答案.该compilerArgument标签需要里面去plugin/configuration标记.这是一个完整的例子:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26980 次 |
| 最近记录: |