On Wednesday, July 11, 2007, 9:40:29 PM, Alessandro <[EMAIL PROTECTED]> wrote:
> I'm currently evaluating to maven2 restructure several J2EE projects in > order to have a more organized build process, but I couldn't find > information on how to transition the ant/xdoclet1 build scripts to > maven2/xdoclet1, worse, the few mentions that I found was regarding > maven1/xdoclet1 and maven2/xdoclet2. > The plugins I need to execute are EJB, WEB, STRUTS and HIBERNATE, and the > code is Java 5.0. > I would appreciate if someone has pointers to pom.xml examples in these > scenarios. > Thanks for any clues, > Alessandro Well, I think that the first thing you should try should be XDoclet2, although when I switched my project using XDoclet1 to Maven2, it was less advanced than it is now, so I've not done so myself! Anyway, if you can't get X2 working for you, you can use X1, with the following sort of thing, but there is a catch - See later... <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xdoclet-maven-plugin</artifactId> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>xdoclet</goal> </goals> <configuration> <tasks> <webdoclet destdir="${project.build.directory}/generated-sources/xdoclet/META-INF"> <fileset dir="${project.build.sourceDirectory}"> <include name="**/*.java" /> </fileset> <deploymentdescriptor servletspec="2.3" /> </webdoclet> </tasks> </configuration> </execution> </executions> </plugin> or <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xdoclet-maven-plugin</artifactId> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>xdoclet</goal> </goals> <configuration> <generatedSourcesDirectory>${project.build.directory}/xdoclet</generatedSourcesDirectory> <tasks> <ejbdoclet excludedtags="@version,@author" addedtags="@xdoclet-generated at ${NOW_UK},@author XDoclet" verbose="false" ejbSpec="2.1" destDir="${project.build.directory}/xdoclet" force="false"> <fileset dir="${project.build.sourceDirectory}"> <include name="**/*Bean.java" /> <include name="**/*MDB.java" /> </fileset> <remoteinterface /> <localinterface /> <homeinterface /> <localhomeinterface /> <dataobject /> <entitypk /> <deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF" /> </ejbdoclet> <ejbdoclet excludedtags="@version,@author" addedtags="@xdoclet-generated at ${NOW_UK},@author XDoclet" verbose="false" ejbSpec="2.0" destDir="${project.build.directory}/xdoclet" force="false"> <fileset dir="${project.build.sourceDirectory}"> <include name="**/*Bean.java" /> <include name="**/*MDB.java" /> </fileset> <weblogic datasource="jdbc/TxTopUpDB" createtables="Disabled" databaseType="ORACLE" destDir="${project.build.outputDirectory}/META-INF" validateXML="true" version="8.1" /> </ejbdoclet> </tasks> </configuration> </execution> </executions> </plugin> Now, the catch! From memory, as this was a while ago... There's a bug that was introduced in the last released version that means that the second run of XDoclet in a build (e.g. the two "ejbdoclet" tasks above) fails to work properly - I don't recall the details, but I think it was a side-effect of a patch that Matt Riable added. I believe it was eventually backed out and the CVS/SVN updated, or at least the snapshot I took sometime ago had a working version, but the problem is that project's stalled & there's been no one there/no one with time & inclination to do a new release, so to use the above, you'd have to build your own version from source (which I have a faint recollection may need Maven 1, but that might just have been for the site or documentation) then add it to your local Maven2 repo. /Gwyn ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user