dion        2003/08/21 18:34:09

  Modified:    src/plugins-build/javadoc plugin.jelly
               src/plugins-build/javadoc/xdocs properties.xml
  Log:
  Fix for MAVEN-694
  Thanks to Martin Skopp.
  
  Patch was applied with some changes
  
  Revision  Changes    Path
  1.18      +35 -3     maven/src/plugins-build/javadoc/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/javadoc/plugin.jelly,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- plugin.jelly      22 Jul 2003 12:04:19 -0000      1.17
  +++ plugin.jelly      22 Aug 2003 01:34:09 -0000      1.18
  @@ -66,9 +66,17 @@
         <ant:property name="title" value="${pom.name} ${pom.currentVersion} API"/>
   
         <j:choose>
  -        <j:when test="${maven.mode.online}"/>
  +        <j:when test="${maven.mode.online}">
  +          <util:tokenize var="links" delim="," 
trim="true">${maven.javadoc.links}</util:tokenize>
  +          <j:forEach var="link" items="${links}">
  +            <ant:echo>Linking with API information from ${link.trim()} 
...</ant:echo>
  +          </j:forEach>
  +        </j:when>
           <j:otherwise>
  -          <j:set var="maven.javadoc.links" value=""/>
  +          <util:tokenize var="links" delim="," 
trim="true">${maven.javadoc.offlineLinks}</util:tokenize>
  +          <j:forEach var="link" items="${links}">
  +            <ant:echo>Linking offline API information from ${link.trim()} 
...</ant:echo>
  +          </j:forEach>
           </j:otherwise>
         </j:choose>
   
  @@ -119,9 +127,33 @@
             <ant:setProperty name="source" value="${maven.javadoc.source}" />
           </j:if>
   
  +        <!-- Process/Parse links -->
  +        <!-- This code allows to specify a packagelistLoc even when in online mode 
-->
           <j:forEach var="link" items="${links}">
  -          <ant:link href="${link.trim()}"/>
  +          <j:set var="pos" value="${link.indexOf('#')}" />
  +
  +          <!-- set href and packagelistLoc -->
  +          <j:choose>
  +            <!-- I am bad with jelly, the test is: "pos == -1" -->
  +            <j:when test="${1+pos == 0}">
  +              <j:set var="href" value="${link.trim()}" />
  +              <j:set var="packagelistLoc" value="${href}"/>
  +            </j:when>
  +            <j:otherwise>
  +              <j:set var="href" value="${link.substring(0,pos).trim()}"/>
  +              <j:set var="packagelistLoc" 
value="${link.substring(pos).substring(1).trim()}"/>
  +            </j:otherwise>
  +          </j:choose>
  +
  +          <!-- generate the link -->
  +          <j:choose>
  +            <j:when test="${maven.mode.online}" />
  +              <ant:link href="${href}" offline="false" 
packagelistLoc="${packagelistLoc}" />
  +            <j:otherwise />
  +              <ant:link href="${href}" offline="true"  
packagelistLoc="${packagelistLoc}" />
  +          </j:choose>
           </j:forEach>
  +
           <ant:classpath>
             <ant:path refid="maven.dependency.classpath"/>
             <ant:path location="${maven.build.dest}"/>
  
  
  
  1.4       +51 -0     maven/src/plugins-build/javadoc/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven/src/plugins-build/javadoc/xdocs/properties.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- properties.xml    21 Mar 2003 14:51:06 -0000      1.3
  +++ properties.xml    22 Aug 2003 01:34:09 -0000      1.4
  @@ -59,6 +59,57 @@
             </td>
           </tr>
           <tr>
  +          <td>maven.javadoc.links</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>
  +            Comma separated list of URLs to create links to javadoc output of 
  +            other packages in online mode (maven.online.mode=true), works like 
  +            the "-link" option of the javadoc command.
  +            </p>
  +            <p>
  +            The URLs must link to a directory where the javadoc generated file
  +            "package-list" is accesible for the package.
  +            </p>
  +            <p>Example:</p>
  +            <source>
  +maven.javadoc.links=http://java.sun.com/j2se/1.4.2/docs/api/, 
http://maven.apache.org/apidocs/
  +            </source>
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.javadoc.offlineLinks</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>
  +            Comma seperated list of URLs to create links to javadoc output of 
  +            other packages in offline mode (maven.online.mode=false), works like
  +            the "-linkoffline" option of the javadoc command.
  +            Comma seperated list of URLs to create links to javadoc output of 
  +            other packages, works like the "-link" option of the javadoc command.
  +            </p>
  +            <p>
  +            The URLs must link to a directory where the javadoc generated file
  +            "package-list" is accesible for the package.
  +            </p>
  +            <p>Example (generates <b>offline</b> links in offline mode):</p>
  +            <source>
  +maven.javadoc.offlineLinks=/opt/java-apidoc/j2sdk1.4.1/docs/api/, 
/cvsroot/maven/target/docs/apidocs/
  +            </source>
  +            <p>
  +            Generation of online javadoc links in offline mode is also possible.
  +            You need to provide the online URL plus the a offline directory 
  +            resource for "package-list".  URL and directory need to be seperated
  +            by the "#" character.
  +            </p>
  +            <p>Example (generates <b>online</b> links in offline mode):</p>
  +            <source>
  
+maven.javadoc.offlineLinks=http://java.sun.com/j2se/1.4.2/docs/api/#/opt/java-apidoc/j2sdk1.4.1/docs/api/,
 \
  +  http://maven.apache.org/apidocs/#/cvsroot/maven/target/docs/apidocs/
  +            </source>
  +          </td>
  +        </tr>
  +        <tr>
             <td>maven.javadoc.private</td>
             <td>Yes</td>
             <td>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to