[ http://jira.codehaus.org/browse/MOJO-223?page=comments#action_82721 ] 
            
Davy Toch commented on MOJO-223:
--------------------------------

I know it's an ugly hack to patch the official xdoclet 1.2.3 jars, but the 
error message "Ambiguous subtask ..." is a real blocker for using XDoclet in 
M2. However, perhaps the following is a better solution (however still a hack):

- get the XDoclet 1.2.3 sources from CVS (not the latest trunk)
- copy the file core\src\xdoclet\DocletTask.java of XDoclet 1.2.3 to the folder 
xdoclet-maven-plugin\src\main\java\ of the Maven 2 XDoclet plugin
- in the file DocletTask.java, uncomment the following lines after the comment 
"// Fix for ... XDT-879":

            //subtaskNameMap = null;
            //subtaskMap = null;
            //destDir = null;
            //mergeDir = null;
            //subTasks = null;
            //configParams = null;

(on the XDoclet mailing lists it is indicated that this "fix" for XDT-879 is 
what causes the "Ambiguous subtask ..." message)

- in xdoclet-maven-plugin\pom.xml, modify the scope from "runtime" to "compile" 
for the following dependencies:

* xdoclet:xdoclet
* xjavadoc:xjavadoc

- create a new version of the xdoclet-maven-plugin (mvn clean install)

After this, the error message "Ambiguous subtask ..." didn't appear anymore in 
my M2 reactor build. However, if I have some time, I'll check if I didn't 
introduce some negative side-effects by modifying the scope of the dependencies.

> xdoclet maven plugin: Ambiguous subtask definition exception
> ------------------------------------------------------------
>
>                 Key: MOJO-223
>                 URL: http://jira.codehaus.org/browse/MOJO-223
>             Project: Mojo
>          Issue Type: Bug
>          Components: xdoclet
>         Environment: maven 2.0.1
>            Reporter: Corridor Software Developer
>         Assigned To: Corridor Software Developer
>            Priority: Blocker
>         Attachments: xdoclet.patch
>
>
> Get the following error when building a project with webapp and ejb projects 
> which both use the maven xdoclet plugin. Running the installs from the 
> individual project dirs does not produce the same result:
> [ERROR] BUILD ERROR
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Error executing ant tasks
> Embedded error: Ambiguous subtask definition for logical name 
> service-endpoint: xdoclet.modules.ejb.intf.ServiceEndpointSubTask and 
> xdoclet.modules.web.ServiceEndpointSubTask
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant 
> tasks
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         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:585)
>         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 executing 
> ant tasks
>         at 
> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:77)
>         at org.codehaus.mojo.xdoclet.XDocletMojo.execute(XDocletMojo.java:102)
>         at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
>         at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
>         ... 16 more
> Caused by: Ambiguous subtask definition for logical name service-endpoint: 
> xdoclet.modules.ejb.intf.ServiceEndpointSubTask and 
> xdoclet.modules.web.ServiceEndpointSubTask
>         at xdoclet.DocletTask.registerModules(DocletTask.java:566)
>         at xdoclet.DocletTask.createDynamicElement(DocletTask.java:336)
>         at 
> org.apache.tools.ant.IntrospectionHelper.getNestedCreator(IntrospectionHelper.java:505)
>         at 
> org.apache.tools.ant.IntrospectionHelper.getElementCreator(IntrospectionHelper.java:583)
>         at 
> org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:545)
>         at 
> org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:326)
>         at 
> org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:182)
>         at 
> org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:158)
>         at org.apache.tools.ant.Task.perform(Task.java:363)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at 
> org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:71)
>         ... 19 more
> the task for the ejb:
>            <ejbdoclet destdir="${project.build.outputDirectory}">
>              <fileset dir="src/main/java"/>
>              <entitycmp/>
>              <deploymentdescriptor 
> destDir="${project.build.outputDirectory}/META-INF" />
>            </ejbdoclet>
> the task for the webapp:
>                   <webdoclet 
> destdir="${project.build.directory}/${project.build.finalName}/WEB-INF" 
> verbose="true"
>                      excludedtags="@version,@author">
>                      <fileset dir="${basedir}/src/main/java" 
> includes="**/*.java" />
>                      <strutsconfigxml 
> destDir="${project.build.directory}/${project.build.finalName}/WEB-INF"/>
>                   </webdoclet>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to