When running a Maven 2 build with an EJB and Webapp project that both use XDoclet (1.2.3), you receive an “Ambiguous subtask definition” error when calling XDoclet the second time.
Reason is this XDoclet bug, but since XDoclet is dead all you can do about it is patch the “DocletTask.java” by yourself, uncommenting the lines 472 and 473:
DocletContext.setSingleInstance(null);
// Fix for ...
subtaskNameMap = null; // uncommented
subtaskMap = null; // uncommented
//destDir = null;
//mergeDir = null;
//subTasks = null;
//configParams = null;
See http://jira.codehaus.org/browse/MOJO-223

Update

A better way is to use the latest snapshot of the Xdoclet Maven Plugin:
[...]
<pluginRepositories>
  <pluginRepository>
    <id>CodehausSnapshots</id>
    <name>CodehausSnapshots</name>
    <url>http://snapshots.repository.codehaus.org</url>
    <layout>default</layout>
    <releases><enabled>false</enabled></releases>
    <snapshots><enabled>true</enabled></snapshots>
  </pluginRepository>
</pluginRepositories>
[...]
<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>xdoclet-maven-plugin</artifactId>
      <version>1.0-beta-1-SNAPSHOT</version>
      [...]
    </plugin>
  </plugins>
</build>