如何在 Ant 构建任务中使用 -Xlint:unchecked 重新编译? [英] How to recompile with -Xlint:unchecked in Ant build task?

查看:52
本文介绍了如何在 Ant 构建任务中使用 -Xlint:unchecked 重新编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 Antbuild.xml"文件的compile"目标时,我收到以下消息:

When I run the "compile" target of my Ant "build.xml" file, then I get the following message:

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

我的编译目标如下:

  <target name="compile">
    <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source" includeantruntime="false">
      <classpath refid="class.path" />
    </javac>
    <javac srcdir="${test.dir}" destdir="${classes.dir}" debug="true" debuglevel="lines,source" includeantruntime="false">
      <classpath refid="class.path" />
    </javac>
  </target>

我必须在 build.xml 文件中更改哪些内容才能在那里完成 -Xlint:unchecked?

What do I have to change in my build.xml file so that -Xlint:unchecked is done there?

推荐答案

</javac> 部分添加以下元素:

Add the following element in <javac></javac> section:

<compilerarg value="-Xlint:unchecked" />

这篇关于如何在 Ant 构建任务中使用 -Xlint:unchecked 重新编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆