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

javadoc:javadoc goal fails with Maven 2.0.10 or 2.1.0, but works with 2.0.9

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Mac OS X 10.5.6
      Java 1.5.0_16
      Maven 2.0.10 or 2.1.0
      maven-javadoc-plugin 2.5

      Description

      Attempting to use the maven-javadoc-plugin with a pom.xml that works with Maven 2.0.9 fails to work with 2.0.10 or 2.1.0. The error message produced is:

      [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - invalid flag: -author

      The javadoc plugin configuration from the pom.xml is:

      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
      	<artifactId>maven-javadoc-plugin</artifactId>
      	<executions>
      		<execution>
      			<goals>
      				<goal>javadoc</goal>
      			</goals>
      			<phase>compile</phase>
      		</execution>
      	</executions>
      	<configuration>
      		<encoding>UTF-8</encoding>
      		<verbose>false</verbose>
      		<show>public</show>
      		<subpackages>com.sinfoma.sintransfer.rest.services.resources
      		</subpackages>
      		<doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet
      		</doclet>
      		<docletArtifacts>
      			<docletArtifact>
      				<groupId>com.sun.jersey.contribs</groupId>
      				<artifactId>wadl-resourcedoc-doclet
      				</artifactId>
      				<version>${jersey-release-version}
      				</version>
      			</docletArtifact>
      			<!--
      				Also specify jersey and xerces as doclet artifacts as the
      				ResourceDoclet uses classes provided by them to generate the
      				resourcedoc.
      			-->
      			<docletArtifact>
      				<groupId>com.sun.jersey</groupId>
      				<artifactId>jersey-server</artifactId>
      				<version>${jersey-release-version}
      				</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>xerces</groupId>
      				<artifactId>xercesImpl</artifactId>
      				<version>2.9.1</version>
      			</docletArtifact>
      		</docletArtifacts>
      		<additionalparam>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalparam>
      	</configuration>
      </plugin>
      

      With the following additional configuration in the active profile:

      <plugin>
      	<groupId>org.apache.maven.plugins
      	</groupId>
      	<artifactId>maven-javadoc-plugin</artifactId>
      	<configuration>
      		<docletArtifacts>
      			<docletArtifact>
      				<groupId>com.sun.jersey.contribs
      				</groupId>
      				<artifactId>maven-wadl-plugin</artifactId>
      				<version>${jersey-release-version}
      				</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>com.sun.jersey.contribs
      				</groupId>
      				<artifactId>wadl-resourcedoc-doclet
      				</artifactId>
      				<version>${jersey-release-version}
      				</version>
      			</docletArtifact>
      			<!--
      				Also specify jersey and xerces as doclet artifacts as the
      				ResourceDoclet uses classes provided by them to generate the
      				resourcedoc.
      			-->
      			<docletArtifact>
      				<groupId>com.sun.jersey</groupId>
      				<artifactId>jersey-server</artifactId>
      				<version>${jersey-release-version}
      				</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>xerces</groupId>
      				<artifactId>xercesImpl</artifactId>
      				<version>2.9.1</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>javax.xml.bind</groupId>
      				<artifactId>jaxb-api</artifactId>
      				<version>2.1</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>com.sun.xml.bind</groupId>
      				<artifactId>jaxb-impl</artifactId>
      				<version>2.1.10</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>javax.activation</groupId>
      				<artifactId>activation</artifactId>
      				<version>1.1</version>
      			</docletArtifact>
      			<docletArtifact>
      				<groupId>javax.xml.stream</groupId>
      				<artifactId>stax-api</artifactId>
      				<version>1.0</version>
      			</docletArtifact>
      		</docletArtifacts>
      	</configuration>
      </plugin>
      

        Issue Links

          Activity

          Jonathan Harlap created issue -
          Benjamin Bentmann made changes -
          Field Original Value New Value
          Description Attempting to use the maven-javadoc-plugin with a pom.xml that works with Maven 2.0.9 fails to work with 2.0.10 or 2.1.0. The error message produced is:

          [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - invalid flag: -author

          The javadoc plugin configuration from the pom.xml is:

          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
          <execution>
          <goals>
          <goal>javadoc</goal>
          </goals>
          <phase>compile</phase>
          </execution>
          </executions>
          <configuration>
          <encoding>UTF-8</encoding>
          <verbose>false</verbose>
          <show>public</show>
          <subpackages>com.sinfoma.sintransfer.rest.services.resources
          </subpackages>
          <doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet
          </doclet>
          <docletArtifacts>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs</groupId>
          <artifactId>wadl-resourcedoc-doclet
          </artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <!--
          Also specify jersey and xerces as doclet artifacts as the
          ResourceDoclet uses classes provided by them to generate the
          resourcedoc.
          -->
          <docletArtifact>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-server</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>2.9.1</version>
          </docletArtifact>
          </docletArtifacts>
          <additionalparam>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalparam>
          </configuration>
          </plugin>

          With the following additional configuration in the active profile:

          <plugin>
          <groupId>org.apache.maven.plugins
          </groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
          <docletArtifacts>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs
          </groupId>
          <artifactId>maven-wadl-plugin</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs
          </groupId>
          <artifactId>wadl-resourcedoc-doclet
          </artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <!--
          Also specify jersey and xerces as doclet artifacts as the
          ResourceDoclet uses classes provided by them to generate the
          resourcedoc.
          -->
          <docletArtifact>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-server</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>2.9.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
          <version>2.1.10</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
          <version>1.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
          <version>1.0</version>
          </docletArtifact>
          </docletArtifacts>
          </configuration>
          </plugin>
          Attempting to use the maven-javadoc-plugin with a pom.xml that works with Maven 2.0.9 fails to work with 2.0.10 or 2.1.0. The error message produced is:

          [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - invalid flag: -author

          The javadoc plugin configuration from the pom.xml is:
          {code:xml}
          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
          <execution>
          <goals>
          <goal>javadoc</goal>
          </goals>
          <phase>compile</phase>
          </execution>
          </executions>
          <configuration>
          <encoding>UTF-8</encoding>
          <verbose>false</verbose>
          <show>public</show>
          <subpackages>com.sinfoma.sintransfer.rest.services.resources
          </subpackages>
          <doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet
          </doclet>
          <docletArtifacts>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs</groupId>
          <artifactId>wadl-resourcedoc-doclet
          </artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <!--
          Also specify jersey and xerces as doclet artifacts as the
          ResourceDoclet uses classes provided by them to generate the
          resourcedoc.
          -->
          <docletArtifact>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-server</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>2.9.1</version>
          </docletArtifact>
          </docletArtifacts>
          <additionalparam>-output ${project.build.outputDirectory}/resourcedoc.xml</additionalparam>
          </configuration>
          </plugin>
          {code}
          With the following additional configuration in the active profile:
          {code:xml}
          <plugin>
          <groupId>org.apache.maven.plugins
          </groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
          <docletArtifacts>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs
          </groupId>
          <artifactId>maven-wadl-plugin</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>com.sun.jersey.contribs
          </groupId>
          <artifactId>wadl-resourcedoc-doclet
          </artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <!--
          Also specify jersey and xerces as doclet artifacts as the
          ResourceDoclet uses classes provided by them to generate the
          resourcedoc.
          -->
          <docletArtifact>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-server</artifactId>
          <version>${jersey-release-version}
          </version>
          </docletArtifact>
          <docletArtifact>
          <groupId>xerces</groupId>
          <artifactId>xercesImpl</artifactId>
          <version>2.9.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
          <version>2.1.10</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
          <version>1.1</version>
          </docletArtifact>
          <docletArtifact>
          <groupId>javax.xml.stream</groupId>
          <artifactId>stax-api</artifactId>
          <version>1.0</version>
          </docletArtifact>
          </docletArtifacts>
          </configuration>
          </plugin>
          {code}
          Hide
          Benjamin Bentmann added a comment -

          The snippets you posted don't include a version for the Javadoc Plugin. If this is not configured somewhere else in one your parent POMs, your build will use different plugin versions depending on the Maven version. For instance, Maven 2.0.9 defaults to maven-javadoc-plugin:2.4 while later Maven version default to maven-javadoc-plugin:2.5. So, locking down the plugin version to 2.4 should get your build running regardless of the Maven version.

          Show
          Benjamin Bentmann added a comment - The snippets you posted don't include a version for the Javadoc Plugin. If this is not configured somewhere else in one your parent POMs, your build will use different plugin versions depending on the Maven version. For instance, Maven 2.0.9 defaults to maven-javadoc-plugin:2.4 while later Maven version default to maven-javadoc-plugin:2.5. So, locking down the plugin version to 2.4 should get your build running regardless of the Maven version.
          Hide
          Jonathan Harlap added a comment -

          Thanks for the workaround, although I wonder why it was happening with 2.5 in any case.

          Show
          Jonathan Harlap added a comment - Thanks for the workaround, although I wonder why it was happening with 2.5 in any case.
          Hide
          Peter Niederwieser added a comment -

          It seems that in 2.5, <useStandardDocletOptions> MUST be set to false once <additionalparam> is specified. Otherwise the error mentioned above occurs. Bug?

          Show
          Peter Niederwieser added a comment - It seems that in 2.5, <useStandardDocletOptions> MUST be set to false once <additionalparam> is specified. Otherwise the error mentioned above occurs. Bug?
          David Jencks made changes -
          Link This issue is duplicated by MJAVADOC-234 [ MJAVADOC-234 ]
          David Jencks made changes -
          Link This issue is duplicated by MJAVADOC-237 [ MJAVADOC-237 ]
          Hide
          Siveton Vincent added a comment -

          I tried to call "mvn javadoc:javadoc" on the camel-web project, rev 793860 [1].
          I just added the fusesource repo [2] for maven-jaxb-schemagen-plugin and lock down the javadoc-plugin to 2.5.

          I always get the following error with Maven 2.0.9, 2.0.10, 2.1 and 2.2:

          [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - invalid flag: -author
          

          It is the correct behaviour and as Peter said, you need to add the useStandardDocletOptions parameter using specific doclet:

            <useStandardDocletOptions>false</useStandardDocletOptions>
          

          [1] http://svn.apache.org/repos/asf/camel/trunk/components/camel-web
          [2] http://repo.fusesource.com/maven2/

          Show
          Siveton Vincent added a comment - I tried to call "mvn javadoc:javadoc" on the camel-web project, rev 793860 [1] . I just added the fusesource repo [2] for maven-jaxb-schemagen-plugin and lock down the javadoc-plugin to 2.5. I always get the following error with Maven 2.0.9, 2.0.10, 2.1 and 2.2: [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - javadoc: error - invalid flag: -author It is the correct behaviour and as Peter said, you need to add the useStandardDocletOptions parameter using specific doclet: <useStandardDocletOptions>false</useStandardDocletOptions> [1] http://svn.apache.org/repos/asf/camel/trunk/components/camel-web [2] http://repo.fusesource.com/maven2/
          Siveton Vincent made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Not A Bug [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 11:56:47 UTC 2015 [ 1428235007093 ]
          Mark Thomas made changes -
          Workflow jira [ 12722468 ] Default workflow, editable Closed status [ 12762407 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 00:11:46 UTC 2015 [ 1428279106587 ]
          Mark Thomas made changes -
          Workflow jira [ 12960108 ] Default workflow, editable Closed status [ 12996993 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          102d 19h 55m 1 Siveton Vincent 14/Jul/09 08:12

            People

            • Assignee:
              Unassigned
              Reporter:
              Jonathan Harlap
            • Votes:
              5 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development