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:
// Fix for ...
subtaskNameMap = null; // uncommented
subtaskMap = null; // uncommented
//destDir = null;
//mergeDir = null;
//subTasks = null;
//configParams = null;
See http://jira.codehaus.org/browse/MOJO-223


A better way is to use the latest snapshot of the Xdoclet Maven Plugin: