Search code examples
javaantjavadoc

ant buildfile + javadoc -- including html in javadoc bottom


I am trying to modify the ant build file that comes packaged with a java library I am working with so that it will include links in the javadoc bottom part of the page. I have the variables ${author.name} and ${author.url} in the ant build.xml file. The line in question I am trying to edit is the javadoc bottom="library ${project.name} by ${author.name}." below

<!-- create the java reference of the library -->
<javadoc bottom="library ${project.name} by ${author.name}." 
    classpath="${classpath.local.location}/core.jar;{project.bin}" 
    destdir="${project.tmp}/${project.name}/reference" 
    verbose="false" 
    stylesheetfile="resources/stylesheet.css" 
    doctitle="Javadocs: ${project.name}" 
    public="true" version="false" 
    windowtitle="Javadocs: ${project.name}"      
>

Right now, it prints something like this:

Library myLibrary, by adilapapaya

I would instead like it to include a link to the author page. E.g. something like

Library myLibrary, by adilapapaya.

or even

Library myLibrary, by adilapapaya, http://adilapapaya.com.

but I'm not sure how to add a href to the ant build file above. I've tried

<javadoc bottom="library ${project.name} by <a href=${author.url}>${author.name}</a>."

but I get an error saying that I can't do that. Basically, I'm looking for the ant equivalent of

<a href=${author.url}>${author.name}</a>

Any help would be much appreciated.


Solution

  • What you need to do is add a nested <bottom> element, like this:

    <javadoc ... >
      ...
      <bottom>
        <![CDATA[
          library ${project.name} by <a href="${author.url}">${author.name}</a>
        ]]>
      </bottom>
    </javadoc>
    

    Reference: Ant javadoc task, the first 3 examples show how the "bottom" element is used.