Issue Details (XML | Word | Printable)

Key: MJAVADOC-145
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Vincent Siveton
Reporter: Howard M. Lewis Ship
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Javadoc Plugin

If Javadoc is set to aggregate, the build fails inside a Maven plugin module

Created: 27/Aug/07 10:14 AM   Updated: 14/Sep/09 06:06 AM   Resolved: 10/Sep/07 07:03 AM
Return to search
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments: 1. Java Source File ComponentReport.java (16 kB)
2. File maven.out (642 kB)
3. XML File pom.xml (4 kB)
4. XML File pom.xml (11 kB)

Issue Links:
Duplicate
 
Related


 Description  « Hide

If your project contains a Maven plugin, then it is impossible to build aggregated Javadoc.

As the output (attached) shows, Maven seems to recusively build (what's with all those "skipping" messages?). When it reaches the plugin:

[INFO] Error during page generation

Embedded error: Error rendering Maven report: Error extracting plugin descriptor: 'Goal: component-report already exists in the plugin descriptor for prefix: tapestry-component-report
Existing implementation is: org.apache.tapestry.mojo.ComponentReport
Conflicting implementation is: org.apache.tapestry.mojo.ComponentReport'

I can get by this with the -fn (fail never) option.



Howard M. Lewis Ship added a comment - 27/Aug/07 10:15 AM

Output from "mvn clean install site"


Howard M. Lewis Ship added a comment - 27/Aug/07 10:15 AM

Project master POM.


Howard M. Lewis Ship added a comment - 27/Aug/07 10:16 AM

POM for the tapestry-component-report module.


Howard M. Lewis Ship added a comment - 27/Aug/07 10:16 AM

Mojo class.


Lukas Theussl added a comment - 09/Sep/07 09:25 AM

This seems to be a regression. We just had the same problem in doxia [1], it works with v 2.2.

[1] http://www.nabble.com/can%27t-build-site-tf4408106s177.html


Vincent Siveton added a comment - 10/Sep/07 06:59 AM

It is due to @phase generate-sources and @execute phase="generate-sources" (introduced with MJAVADOC-66).
By default, the DefaultLifecycleExecutor uses the phase defined in the configuration, secondly the phase in the descriptor.


Vincent Siveton added a comment - 10/Sep/07 07:03 AM

fixed in r574213 (removed @execute phase="generate-sources")


Vincent Siveton added a comment - 30/May/08 05:23 PM

FYI I readded @execute phase="generate-sources" and @execute phase=generate-test-sources in r661899
I tried the tapestry build [1] with "mvn site -Pjavadoc" and all seems ok in 2.4 and 2.5-SNAPSHOT

[1] http://svn.apache.org/repos/asf/tapestry/tapestry5/trunk


Christian Schulte added a comment - 28/Dec/08 09:53 AM - edited

Having

<reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.5</version>
        <reportSets>
          <reportSet>
            <id>javadoc</id>
            <inherited>true</inherited>
            <reports>
              <report>javadoc</report>
            </reports>
            <configuration>
              <aggregate>false</aggregate>
              <author>true</author>
              <charset>UTF-8</charset>
              <docencoding>UTF-8</docencoding>
              <encoding>UTF-8</encoding>
              <keywords>true</keywords>
              <doctitle>${pom.name} Specification ${pom.version}</doctitle>
              <linksource>true</linksource>
              <nodeprecated>true</nodeprecated>
              <quiet>false</quiet>
              <verbose>false</verbose>
              <serialwarn>true</serialwarn>
              <windowtitle>${pom.name} Specification ${pom.version}</windowtitle>
              <overview>${basedir}/src/main/javadoc/overview.html</overview>
              <show>public</show>
              <links>
                <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
              </links>
            </configuration>
          </reportSet>
          <reportSet>
            <id>aggregate</id>
            <inherited>false</inherited>
            <reports>
              <report>aggregate</report>
            </reports>
            <configuration>
              <aggregate>true</aggregate>
              <breakiterator>true</breakiterator>
              <charset>UTF-8</charset>
              <docencoding>UTF-8</docencoding>
              <encoding>UTF-8</encoding>
              <keywords>false</keywords>
              <linksource>true</linksource>
              <serialwarn>true</serialwarn>
              <show>private</show>
              <doctitle>${pom.name} Specification ${pom.version}</doctitle>
              <windowtitle>${pom.name} Specification ${pom.version}</windowtitle>
            </configuration>
          </reportSet>
        </reportSets>
      </plugin>

in a parent pom from a multi-module project containing a mojo artifact defined like

* @goal java-resources
 * @phase generate-sources
 * @requiresDependencyResolution compile

still produces a similar stacktrace for me

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error extracting plugin descriptor: 'Goal: java-resources already exists in the plugin descriptor for prefix: some-prefix
Existing implementation is: some.package.JavaResourcesMojo
Conflicting implementation is: some.package.JavaResourcesMojo'
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:924)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:767)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:549)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error extracting plugin descriptor: 'Goal: java-resources already exists in the plugin descriptor for prefix: some-prefix
Existing implementation is: some.package.JavaResourcesMojo
Conflicting implementation is: some.package.JavaResourcesMojo'
        at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:158)
        at org.apache.maven.plugin.plugin.HelpGeneratorMojo.execute(HelpGeneratorMojo.java:63)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        ... 20 more
Caused by: org.apache.maven.plugin.descriptor.DuplicateMojoDescriptorException: Goal: java-resources already exists in the plugin descriptor for prefix: some-prefix
Existing implementation is: some.package.JavaResourcesMojo
Conflicting implementation is: some.package.JavaResourcesMojo
        at org.apache.maven.plugin.descriptor.PluginDescriptor.addMojo(PluginDescriptor.java:103)
        at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:110)
        at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:146)
        ... 23 more

when executing

mvn site:stage -DstagingDirectory=/tmp/staging -e

Vincent Siveton added a comment - 28/Dec/08 10:02 AM

Christian, it is not a Javadoc plugin error so try to open a new issue in MNG with your test case. Thanks!


Martin Desruisseaux added a comment - 20/Jul/09 06:17 AM

Is this bug really fixed? I'm using Maven 2.1 with maven-javadoc-plugin 2.5 in a project having a few Maven plugins, and still get "Error extracting plugin descriptor: Goal already exists in the plugin descriptor" when running mvn clean install site. The same command without the site goal works fine. Removing the aggregated javadoc configuration from the <reporting> section in the root pom.xml fixes the build as well.


Vincent Siveton added a comment - 20/Jul/09 07:42 AM

Martin, it should be.
If you have an error, please create a new issue with a test project, I will have a look to.