How to get javadoc to reference Java API using Ant task?

Now my ant task looks like.

<javadoc sourcepath="${source}" destdir="${doc}"> <link href="http://java.sun.com/j2se/1.5.0/docs/api/" /> </javadoc> 

And I get this warning:

 javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list 

How do I get javadoc for the correct API reference? I am for the proxy.

+4
source share
3 answers

You will probably need http.proxyHost and the properties of the http.proxyPort system . For example, ANT_OPTS="-Dhttp.proxyHost=proxy.y.com" ant doc

Alternatively, you can set the flag β€œoffline” and provide a list of packages, but this can be a pain for the Java kernel.

+6
source

You can also pass arguments inside the ant task

 <arg value="-J-Dhttp.proxyHost=your.proxy.here"/> <arg value="-J-Dhttp.proxyPort=##"/> 

If you go on an offline route. Download the package list by going to the Java API URL ( http://java.sun.com/j2se/1.5.0/docs/api/package-list ) and save it as a text file, and then use this ant.

 <javadoc sourcepath="${source}" destdir="${doc}"> <link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistloc="path-containing-package-list"/> </javadoc> 
+12
source

You can also use the offline mode, which allows you to build (faster!) Without access to the Internet. See This Answer: fooobar.com/questions/810928 / ...

0
source

Source: https://habr.com/ru/post/1276616/


All Articles