What I meant was how do I configure project.xml to generate the MBean interfaces first before compiling the java sources of the project? This is because the sources require the presence of the generated interfaces by xdoclet.
Melvin-
While we aren't doing MBean generation with XDoclet in our main Maven project (we do so with other Ant-driven builds), we ARE using Maven to use XDoclet to generate Hibernate information.
This may be close enough for you to see how it works... it also may not be the IDEAL layout of these files, but it works for us... ;)
...jeff
(By the way, this is for a Life Sciences product we're producing at http://www.benchKeeper.com)
Our project.properties looks like this:
============================================= P R O J E C T . P R O P E R T I E S ============================================================
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}# defines the root directory we build to
build.dir=${basedir}/../../work/code
build.deploy.dir=${build.dir}/deploy
build.lib.dir=${build.dir}/lib# ----------------------------------
# Hibernate Attribute Definition
# ----------------------------------
maven.xdoclet.hibernatedoclet.destDir=${basedir}/src/sar
maven.xdoclet.hibernatedoclet.fileset.0=true
maven.xdoclet.hibernatedoclet.fileset.0.include=**/objectmodel/**/*.java
# --------------------------------- # Dataload Properties # --------------------------------- benchKeeper.dataload.class=com.benchKeeper.objectmodel.dataload.CreateDataloadScript benchKeeper.dataload.file=${basedir}/src/sar/benchKeeper-dataload.xml
Our maven.xml looks like this:
============================================= M A V E N . X M L ============================================================
<project default="build" xmlns:m="maven" xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:maven="jelly:maven" xmlns:deploy="deploy">
<goal name="hibernate">
<delete>
<!-- resolves the problem where the hibernate files can not be in the classpath when we gen -->
<fileset dir="${maven.xdoclet.hibernatedoclet.destDir}" includes="**/*.hbm.xml" />
</delete>
<attainGoal name="xdoclet:hibernatedoclet" />
</goal>
<goal name="build">
<attainGoal name="jar" />
<java classname="${benchKeeper.dataload.class}" failonerror="true" fork="true">
<arg value="${benchKeeper.dataload.file}" />
<classpath>
<path refid="maven.dependency.classpath" />
<path location="${maven.build.dir}/classes" />
</classpath>
</java>
<attainGoal name="sar" />
</goal>
<goal name="sar">
<mkdir dir="${maven.build.dir}" />
<jar destfile="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.sar" basedir="${maven.xdoclet.hibernatedoclet.destDir}" />
<copy file="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.sar" tofile="${build.deploy.dir}/${pom.artifactId}-${pom.currentVersion}.sar" />
</goal>
<goal name="jar">
<!-- installs a snapshot, but does so that it
does not copy the actually current version -->
<attainGoal name="java:jar" />
<copy file="${maven.build.dir}/${maven.final.name}.jar" tofile="${maven.repo.local}/${pom.artifactDirectory}/jars/${pom.artifactId}-CURRENT.jar" overwrite="true" />
<copy file="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.jar" tofile="${build.dir}/lib-benchKeeper/${pom.artifactId}-${pom.currentVersion}.jar" />
</goal>
</project>
and our project.xml looks like this:
============================================= P R O J E C T . X M L ============================================================
<?xml version="1.0" encoding="ISO-8859-1"?> <project> <pomVersion> 3 </pomVersion> <id> benchKeeper-objectmodel </id> <groupId> benchKeeper </groupId> <name> BenchKeeper - ObjectModel </name> <currentVersion> 1.0 </currentVersion> <inceptionYear> 2003 </inceptionYear> <package> com.benchKeeper.objectmodel </package> <shortDescription> The object model </shortDescription> <!-- any mailing lists for the project --> <mailingLists /> <!-- who the developers are for the project --> <developers> <developer> <name> Chris Shorrock </name> <id> cshorrock </id> <email> [EMAIL PROTECTED] </email> <organization> BenchKeeper Software </organization> <roles> <role> Java Developer </role> </roles> </developer> </developers> <!-- jar files the project is dependent on --> <dependencies> <dependency> <id> xdoclet+hibernate-module </id> <version> 1.2b4 </version> </dependency> <dependency> <id> benchKeeper+utils </id> <version> CURRENT </version> </dependency> <dependency> <id> benchKeeper+sharedservices </id> <version> CURRENT </version> </dependency> <dependency> <id> benchKeeper+server-bootstrap </id> <version> CURRENT </version> </dependency> </dependencies> <!-- build information for the project --> <build> <sourceDirectory> src/java </sourceDirectory> <resources> <resource> <directory> ${basedir}/src/conf </directory> <excludes> <exclude> *.DS_Store </exclude> </excludes> </resource> </resources> </build> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
