maven-plugins/javadoc/plugin.jelly
kaz b5bae003a6 Fixing the javadoc plugin. It assumed the maven.gen.docs directory
already existed.  As a result, 'maven javadoc' would fail if it didn't
already exist.  Rather than doing yet another <mkdir> in the javadoc
plugin, I've created an xdoc:init goal that creates the directories.
Any plugin that requires the use of those directories should make this
goal a prereq.  I'll be going through all of the plugins to make this
change.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112741 13f79535-47bb-0310-9956-ffa450edef68
2003-01-25 16:42:51 +00:00

112 lines
3.7 KiB
XML

<?xml version="1.0"?>
<project xmlns:j="jelly:core"
xmlns:util="jelly:util"
xmlns:define="jelly:define"
xmlns:license="license">
<!-- ================================================================== -->
<!-- J A V A D O C S -->
<!-- ================================================================== -->
<!-- Some aliases for ease of use and backward compat. -->
<goal name="javadoc:generate" prereqs="maven-javadoc-plugin:report"/>
<goal name="javadoc" prereqs="maven-javadoc-plugin:report"/>
<goal name="maven-javadoc-plugin:report"
prereqs="xdoc:init"
description="Generate API documentation">
<j:if test="${sourcesPresent == 'true'}">
<mkdir dir="${maven.javadoc.destdir}"/>
<mkdir dir="${maven.gen.docs}" />
<!-- Get the year to display in the Javadocs -->
<tstamp>
<format property="currentYear" pattern="yyyy"/>
</tstamp>
<tstamp>
<j:choose>
<j:when test="${pom.inceptionYear.equals(currentYear)}">
<format property="year" pattern="yyyy"/>
</j:when>
<j:otherwise>
<format property="year" pattern="${pom.inceptionYear}-yyyy"/>
</j:otherwise>
</j:choose>
</tstamp>
<property name="copyright"
value="Copyright &amp;copy; ${year} ${pom.organization.name}. All Rights Reserved." />
<property name="title" value="${pom.name} ${pom.currentVersion} API"/>
<j:choose>
<j:when test="${maven.mode.online}"/>
<j:otherwise>
<j:set var="maven.javadoc.links" value=""/>
</j:otherwise>
</j:choose>
<util:tokenize var="links" delim="," trim="true">${maven.javadoc.links}</util:tokenize>
<j:forEach var="link" items="${links}">
<echo>Linking with API information from ${link.trim()} ...</echo>
</j:forEach>
<j:set var="maxMemory" value="${maven.javadoc.maxmemory}" />
<mkdir dir="${maven.build.dir}/javadoc/" />
<record name="${maven.build.dir}/javadoc/report.txt" action="start" />
<javadoc
sourcepathref="maven.compile.src.set"
packagenames="${pom.package}.*"
destdir="${maven.javadoc.destdir}"
author="${maven.javadoc.author}"
private="${maven.javadoc.private}"
version="${maven.javadoc.version}"
use="${maven.javadoc.use}"
windowtitle="${title}"
doctitle="${title}"
bottom="${copyright}"
stylesheetfile="${maven.javadoc.stylesheet}">
<j:if test="${context.getVariable('maven.javadoc.source') != null}">
<setProperty name="source" value="${maven.javadoc.source}" />
</j:if>
<j:forEach var="link" items="${links}">
<link href="${link.trim()}"/>
</j:forEach>
<classpath>
<path refid="maven.dependency.classpath"/>
<path location="${maven.build.dest}"/>
</classpath>
<j:if test="${maxMemory != null}">
<setProperty name="maxmemory" value="${maven.javadoc.maxmemory}" />
</j:if>
<j:forEach var="packageGroup" items="${pom.packageGroups}">
<group title="${packageGroup.title}" packages="${packageGroup.packages}"/>
</j:forEach>
</javadoc>
<record name="${maven.build.dir}/javadoc/report.txt" action="stop" />
<j:set var="genDocs" value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}" />
<license:license
description="Javadoc Report"
input="${maven.build.dir}/javadoc/report.txt"
output="${genDocs}/javadoc.xml"
outputEncoding="${maven.docs.outputencoding}"
title="Javadoc"
/>
</j:if>
</goal>
</project>