Ant/Maven:“javadoc:警告 - 获取 URL 时出错"; [英] Ant/Maven: "javadoc: warning - Error fetching URL"
问题描述
我最近设置了我的构建服务器 (Jenkins) 来为 Ant 构建生成 Javadoc.但是,无论我做什么,我都无法让它包含指向外部库的链接.当我尝试使用在线链接时,Ant 返回:
I recently set up my build server (Jenkins) to generate Javadocs for Ant builds. However, no matter what I do, I can't get it to include links to external libraries. When I attempt to use an online link, Ant returns:
[javadoc] javadoc: warning - Error fetching URL: http://docs.oracle.com/javase/6/docs/api/package-list
当我使用离线链接并引用包列表的本地副本时,它不会发出警告,但也不会生成链接.这发生在我尝试链接的每个库中,而不仅仅是 Java SE.以下是我的 build.xml 中链接的相应行:
When I use an offline link and reference a local copy of a package list, it gives no warnings, but doesn't generate links either. This occurs for every library I attempt to link, not just Java SE. Here are the respective lines for links in my build.xml:
<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/" packagelistLoc="javadoc/javase6/package-list" />
和:
<link href="http://docs.oracle.com/javase/6/docs/api/" />
值得一提的是,服务器的互联网连接并没有特别不寻常的配置.经过一番研究,我发现使用代理时收到的警告很常见,但我找不到任何在直接连接的服务器上返回的情况.
It's worth mentioning that the internet connection of the server doesn't have a particularly unusual configuration. After a bit of research, I found that the warning I received is common when using a proxy, but I couldn't find any cases where it was returned on a server with a direct connection.
我还想提一下,我已经验证我的离线包列表位于正确的位置,并且可以通过构建文件的相对路径访问.
I'd also like to mention that I've verified that my offline package list is in the proper location and accessible via a relative path from the build file.
编辑 #1:这显然也是 Maven 上的一个问题,表明 Javadoc 工具本身已损坏.
Edit #1: This is apparently an issue on Maven as well, suggesting that the Javadoc tool itself is broken.
编辑 #2:值得一提的是,我正在使用 JDK 1.6 更新 45 进行编译.
Edit #2: It's worth mentioning that I'm using JDK 1.6 update 45 to compile.
推荐答案
<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/"
packagelistLoc="javadoc/javase6/package-list" />
应该是:
<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/"
packagelistLoc="javadoc/javase6/" />
packagelistLoc
是包含 package-list
文件的目录的路径.
packagelistLoc
is a path to directory containing package-list
file.
这篇关于Ant/Maven:“javadoc:警告 - 获取 URL 时出错";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!