Javadoc:将警告视为错误?
使用 Javadoc 时是否可以将警告视为错误?特别是,我从 Ant 调用 Javadoc 并在我的
任务上设置了 failonerror="true"
,但我似乎无法触发此操作。尽管 javadoc
正在生成警告,但当 Ant 完成时,我仍然得到 BUILD SUCCESSFUL
,退出代码为 0
。
我希望能够向
任务的 additionalparam
属性添加一些内容,以强制 Javadoc 警告失败。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道这已经很旧了,但对于像我一样寻找答案的人来说可能仍然有帮助。如果它不起作用,请将 更改
为您在输出中看到的文本。
编辑:
如果您有一个警告,这将不起作用,要修复所有警告,您必须更改此设置:
I know this is old but it might still be helpful for someone looking for the answer like I was. If it doesn't work change the
to the text you see with your output.
edit:
If you have one warning this will not work, to fix for ALL warnings you must change this:
Ant 1.9.4 现在有failonwarning =“true”
http://ant.apache.org/手册/任务/javadoc.html
Ant 1.9.4 now has failonwarning="true"
http://ant.apache.org/manual/Tasks/javadoc.html
我不知道 JavaDoc 参数,我建议在 ant 构建中使用 checkstyle 这样的工具像这样。您可以将其设置为在出现 Javadoc 警告时失败。
I don't know about a JavaDoc parameter, I would recommend using a tool like checkstyle in your ant build for things like this. You can set it up to fail on Javadoc warnings.