简体   繁体   English

Ant / Maven:“javadoc:warning - 获取URL时出错”

[英]Ant/Maven: “javadoc: warning - Error fetching URL”

I recently set up my build server (Jenkins) to generate Javadocs for Ant builds. 我最近设置了我的构建服务器(Jenkins)来为Ant构建生成Javadocs。 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: 当我尝试使用在线链接时,Ant返回:

[javadoc] javadoc: warning - Error fetching URL: http://docs.oracle.com/javase/6/docs/api/package-list

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. 这种情况发生在我尝试链接的每个库中,而不仅仅是Java SE。 Here are the respective lines for links in my build.xml: 以下是我的build.xml中链接的相应行:

<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/" packagelistLoc="javadoc/javase6/package-list" />

and: 和:

<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. 我还想提一下,我已经验证我的离线包列表位于正确的位置,并且可以通过构建文件的相对路径访问。

Edit #1: This is apparently an issue on Maven as well, suggesting that the Javadoc tool itself is broken. 编辑#1:这显然也是Maven的一个问题,这表明Javadoc工具本身已被破坏。

Edit #2: It's worth mentioning that I'm using JDK 1.6 update 45 to compile. 编辑#2:值得一提的是我正在使用JDK 1.6 update 45进行编译。

<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/"
    packagelistLoc="javadoc/javase6/package-list" />

should be: 应该:

<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/"
    packagelistLoc="javadoc/javase6/" />

packagelistLoc is a path to directory containing package-list file. packagelistLoc是包含package-list文件的目录的路径。

它工作正常,但为了清楚起见,您需要首先从Oracle网站下载软件包列表文件,例如http://docs.oracle.com/javase/6/docs/api/package-list ,并保存该文件到您指定的文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM