Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-332

outputDirectory is not honored as it should, but valuated to destDir.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      WXP SP3 JDK 1.6.0_26 Maven 3.0
    • Number of attachments :
      0

      Description

      Hi

      The outputDirectory is referencing $

      {destDir} instead of ${outputDirectory} as per following snippet extracted from AbstractJavadocMojo.java

      /**
      * Specifies the destination directory where javadoc saves the generated HTML files.
      * <br/>
      * See <a href="http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#d">d</a>.
      * <br/>
      *
      * @parameter expression="${destDir}

      " alias="destDir" default-alue="$

      {project.build.directory}

      /apidocs"

      • @required
        */
        protected File outputDirectory;

        Activity

        Hide
        Dennis Lundberg added a comment -

        I'm not sure what it is that you want.

        The alias="destDir" indicates that this parameter has been renamed from "destDir" to "outputDirectory". The alias makes it possible to keep the old name of the parameter for backwards compatibility.

        The expression="$

        {destDir}

        " part means that if you want to specify this parameter on the command line you should use the syntax:
        -DdestDir=my/chosen/path

        Show
        Dennis Lundberg added a comment - I'm not sure what it is that you want. The alias="destDir" indicates that this parameter has been renamed from "destDir" to "outputDirectory". The alias makes it possible to keep the old name of the parameter for backwards compatibility. The expression="$ {destDir} " part means that if you want to specify this parameter on the command line you should use the syntax: -DdestDir=my/chosen/path
        Hide
        zosrothko added a comment -

        What I want is to put the directory where are generated the javadocs outside the target/site directory and none of the outpuDirectory ot destDist parameters let me do so. It is like the kink option that always produces an ablsolute file while it should be relative if it has beeing specified as relative.

        As exemple

        with
        <destDir>api/als</destDir>
        <detectLinks>true</detectLinks>
        <links>
        <link>../asn</link>
        <link>../ugn</link>
        </links>

        the plugin generates link as below

        D:/OSI/iso.itu.osi.als/target/site/apidocs/api/als\../asn/package-list

        which is not what I am expecting since the asn/package-list will never located under the target site/apidocs/als directory...

        IMHO, all path should be relative to the expressed outputDirectory where anyone can put its own link referrals.

        Show
        zosrothko added a comment - What I want is to put the directory where are generated the javadocs outside the target/site directory and none of the outpuDirectory ot destDist parameters let me do so. It is like the kink option that always produces an ablsolute file while it should be relative if it has beeing specified as relative. As exemple with <destDir>api/als</destDir> <detectLinks>true</detectLinks> <links> <link>../asn</link> <link>../ugn</link> </links> the plugin generates link as below D:/OSI/iso.itu.osi.als/target/site/apidocs/api/als\../asn/package-list which is not what I am expecting since the asn/package-list will never located under the target site/apidocs/als directory... IMHO, all path should be relative to the expressed outputDirectory where anyone can put its own link referrals.
        Hide
        zosrothko added a comment -

        With this configuration
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <!--
        <executions>
        <execution>
        <id>aggregate</id>
        <goals>
        <goal>aggregate</goal>
        </goals>
        <phase>site</phase>
        </execution>
        </executions>
        -->
        <configuration>
        <outputDirectory>$

        {basedir}

        </outputDirectory>
        <destDir>api</destDir>
        </configuration>
        </plugin>

        then outputDir is totally ignored while destDir redirects to target/site/apidocs/api

        as view in the log
        Constructing Javadoc information...
        Standard Doclet version 1.6.0_24
        Building tree for all the packages and classes...
        Generating C:/Documents and Settings/C59FAND/Mes documents/g37idn/asm/target/site/apidocs/api\test/\Edition.html...

        With such configuration, i am expecting that the javadoc be produced in
        Generating C:/Documents and Settings/C59FAND/Mes documents/g37idn/asm/api

        Show
        zosrothko added a comment - With this configuration <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <!-- <executions> <execution> <id>aggregate</id> <goals> <goal>aggregate</goal> </goals> <phase>site</phase> </execution> </executions> --> <configuration> <outputDirectory>$ {basedir} </outputDirectory> <destDir>api</destDir> </configuration> </plugin> then outputDir is totally ignored while destDir redirects to target/site/apidocs/api as view in the log Constructing Javadoc information... Standard Doclet version 1.6.0_24 Building tree for all the packages and classes... Generating C:/Documents and Settings/C59FAND/Mes documents/g37idn/asm/target/site/apidocs/api\test/\Edition.html... With such configuration, i am expecting that the javadoc be produced in Generating C:/Documents and Settings/C59FAND/Mes documents/g37idn/asm/api
        Hide
        Paolo Compieta added a comment -

        Happens also on Ubuntu:
        Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
        Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
        Default locale: en_US, platform encoding: UTF-8
        OS name: "linux", version: "2.6.32-32-generic", arch: "amd64", family: "unix"

        Show
        Paolo Compieta added a comment - Happens also on Ubuntu: Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Java version: 1.6.0_26, vendor: Sun Microsystems Inc. Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-32-generic", arch: "amd64", family: "unix"
        Hide
        Federico Pugnali added a comment -

        The workaround (or the right way to do it) is include also

        <reportOutputDirectory>$

        {basedir}

        </reportOutputDirectory>

        Show
        Federico Pugnali added a comment - The workaround (or the right way to do it) is include also <reportOutputDirectory>$ {basedir} </reportOutputDirectory>
        Hide
        Herve Boutemy added a comment -

        when deploying the site, you'll get what you expect
        it's normal that the site has this "problem" at build time

        Show
        Herve Boutemy added a comment - when deploying the site, you'll get what you expect it's normal that the site has this "problem" at build time

          People

          • Assignee:
            Herve Boutemy
            Reporter:
            zosrothko
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: