Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link third party libraries in Ant's javadoc task

Tags:

java

javadoc

ant

I have a project that uses a third party library in the form of a jar file and I am using Ant to build the project javadocs. I can't get Ant to link to the third-party library javadocs when using the javadoc task.

Here is the javadoc task:

<javadoc excludepackagenames="" access="private" destdir="javadoc" author="true" 
         version="true" use="true" windowtitle="title" useexternalfile="true">
  <fileset dir="." defaultexcludes="yes">
    <include name="*/src/com/**/*.java"/>
  </fileset>

  <link href="http://www.redhillconsulting.com.au/products/simian/javadoc/"/> 
  <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
</javadoc>

The output from the task says that the simian package does not exist:

[javadoc] C:\development\java\tools\src\com\cname\DuplicateCodeIdentifier.java:15: package au.com.redhillconsulting.simian does not exist
[javadoc] import au.com.redhillconsulting.simian.Checker;
[javadoc]                                        ^

Running the ant task creates all the links to the Sun website correctly but not to the redhillconsulting site. Both URLs lead to a package-list file and appropriate paths (matching the package-list contents).

How do I configure the <javadoc> Ant task to generate the links to the third-party site?

Note: The simian jar file is in tools/lib. I haven't seen it specified that any sort of classpath is an option so I haven't explored that avenue but I have tried adding the jar file to the fileset include path and that wasn't any good.

like image 668
Scrubbie Avatar asked Jul 08 '10 19:07

Scrubbie


1 Answers

The javadoc tag accepts an embedded classpath tag

<javadoc ...>
    <classpath>
        <fileset dir="${dir.lib}">
            <include name="simian.jar"/>
        </fileset>
    </classpath>
</javadoc>
like image 165
karoberts Avatar answered Nov 14 '22 23:11

karoberts