Add feature to allow specifying doclet parameters. MPJAVADOC-80

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@531048 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
jjensen 2007-04-21 15:24:44 +00:00
parent 56e6b49f06
commit 62d6a50c4a
4 changed files with 114 additions and 6 deletions

View File

@ -398,10 +398,54 @@ internal_javadoc_src_tmp = [${internal_javadoc_src_tmp}]
<!-- allow custom doclets -->
<!-- ========================== -->
<j:if test="${context.getVariable('maven.javadoc.doclet') != null}">
<ant:setProperty name="doclet" value="${maven.javadoc.doclet}" />
</j:if>
<j:if test="${context.getVariable('maven.javadoc.docletpath') != null}">
<ant:setProperty name="docletpath" value="${maven.javadoc.docletpath}" />
<j:if test="${maven.javadoc.debug}">
<ant:echo>
===============================================================================
Processing custom doclet settings - BEGIN
-------------------------------------------------------------------------------
</ant:echo>
</j:if>
<doclet name="${maven.javadoc.doclet}" path="${maven.javadoc.docletpath}">
<j:if test="${!empty(maven.javadoc.doclet.param.list)}">
<j:if test="${maven.javadoc.debug}">
<ant:echo>Using doclet param list=${maven.javadoc.doclet.param.list}</ant:echo>
</j:if>
<u:tokenize var="items" delim="${maven.javadoc.doclet.param.list.delim}">
${maven.javadoc.doclet.param.list}
</u:tokenize>
<j:forEach var="item" items="${items}">
<j:set var="param.prop.name" value="${item}.name"/>
<j:set var="param.prop.value" value="${item}.value"/>
<!-- get value of variable held in the 'prop' variable -->
<j:set var="param.name" value="${context.getVariable(param.prop.name)}"/>
<j:set var="param.value" value="${context.getVariable(param.prop.value)}"/>
<j:if test="${maven.javadoc.debug}">
<ant:echo>For '${item}', adding param name='${param.name}' value='${param.value}'</ant:echo>
</j:if>
<j:if test="${empty(param.name)}">
<ant:echo>ERROR: Did not find '${param.prop.name}' in properties!</ant:echo>
</j:if>
<j:if test="${empty(param.value)}">
<ant:echo>WARNING: Did not find '${param.prop.value}' in properties! (this may be intended if the param does not have a value)</ant:echo>
</j:if>
<param name="${param.name}" value="${param.value}"/>
</j:forEach>
</j:if>
</doclet>
<j:if test="${maven.javadoc.debug}">
<ant:echo>
-------------------------------------------------------------------------------
Processing custom doclet settings - END
===============================================================================
</ant:echo>
</j:if>
</j:if>
<!-- ========================== -->

View File

@ -27,6 +27,7 @@
<body>
<release version="1.8.1-SNAPSHOT" date="In SVN">
<action dev="aheritier" type="fix">Do not add a directory of sources which doesn't exist.</action>
<action dev="jjensen" type="add" issue="MPJAVADOC-80">Add specifying params with alternate doclets.</action>
</release>
<release version="1.8" date="2006-01-15">
<action dev="ltheussl" type="fix" issue="MPJAVADOC-52">Cannot set -sourcepath to add paths for inherited javadocs.</action>

View File

@ -79,7 +79,17 @@ maven.javadoc.doclet=gr.spinellis.umlgraph.doclet.UmlGraphDoc
maven.javadoc.docletpath=${maven.repo.local}/gr.spinellis/jars/UmlGraph-4.6.jar
maven.javadoc.usestandardparameters=true
</source>
<p>
Maven Javadoc plugin version 1.9 and newer
enables specifying custom doclet parameters.
This makes configuring UMLGraph's doclet possible,
for example, turning on extra class diagram adornments.
Adjust these as desired, referring to the UMLGraph documentation.
</p>
<source>
maven.javadoc.doclet.param.list=umlgraph.all
umlgraph.all.name=-all
</source>
<li>
Install dot (in <a href="http://www.graphviz.org">Graphviz</a>)
and put on PATH (so UmlGraphDoc can run it); e.g. for Windows:
@ -88,6 +98,10 @@ maven.javadoc.usestandardparameters=true
GRAPHVIZ_HOME=(the path)
PATH=%PATH%;%GRAPHVIZ_HOME%\bin
</source>
<p>
Note that UmgGraphDoc outputs an error message
if it could not run dot.
</p>
</ol>
</p>
<p>

View File

@ -340,10 +340,10 @@ tag2.scope=all]]></source>
<section name="Alternate Doclet Settings">
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Optional?</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td>maven.javadoc.doclet</td>
@ -355,6 +355,7 @@ tag2.scope=all]]></source>
See <a href="faq.html#classdiagrams">Class Diagrams FAQ</a>
as an example.
</td>
<td>(none - calls the JavaDoc standard doclet)</td>
</tr>
<tr>
<td>maven.javadoc.docletpath</td>
@ -365,6 +366,7 @@ tag2.scope=all]]></source>
<a href="http://ant.apache.org/manual/CoreTasks/javadoc.html">the
ant javadoc task</a> documentation for more detail.
</td>
<td>(none)</td>
</tr>
<tr>
<td>maven.javadoc.usestandardparameters</td>
@ -378,6 +380,53 @@ tag2.scope=all]]></source>
the plugin does not use the standard doclet parameters
unless this property is set.
</td>
<td>(none)</td>
</tr>
<tr>
<td>maven.javadoc.doclet.param.list</td>
<td>Yes</td>
<td>
<p>
Delimeter separated list of property names
(see maven.javadoc.doclet.param.list.delim),
with each property defining a parameter name and value,
to pass to the doclet.
For example: <code>umlgraph.all,property2.abc,property3.def</code>
</p>
<p>
For every property listed, it expects 2 additional properties:
<dl>
<dt>(propertyname).name</dt>
<dd>The name of the parameter to pass to the doclet.</dd>
<dt>(propertyname).value</dt>
<dd>
The value of the parameter to pass to the doclet.
Note that this can be not specified,
if the parameter name is all that is needed.
</dd>
</dl>
</p>
<p>
For example, to specify the "-all" parameter to the doclet
and "-all" does not have a parameter value:
<source>
maven.javadoc.doclet.param.list=umlgraph.all
umlgraph.all.name=-all
</source>
</p>
</td>
<td>(none)</td>
</tr>
<tr>
<td>maven.javadoc.doclet.param.list.delim</td>
<td>Yes</td>
<td>
<p>
Property name delimeter for list of parameters specified in
maven.javadoc.doclet.param.list.
</p>
</td>
<td>, (comma)</td>
</tr>
</table>
</section>