I have an Ant build file that generates mapping files for some
persistent objects using HibernateMapping plugin.  Here's a copy of
the ant target that runs the plugin:

    <target name="hibernate-gen"
        depends="init, compile"
        description="Generate Persistence and form classes">
        <taskdef
            name="xdoclet"
            classname="org.xdoclet.ant.XDocletTask"
            classpathref="project.classpath"
            />
        <xdoclet>
            <!-- defines the file handled by xdoclet2 -->
            <fileset dir="${src}" />
            <!-- defines the processing of a plugin -->
            <component
                classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
                destdir="${build.doclets}"
                version="3.0"
                />
        </xdoclet>
    </target>

This works fine if I run it from the command line.  However, if I call
it from within another ant build file, it doesn't generate any mapping
files.  Here's an example:

    <target name="dist">
        <ant dir="api" target="dist" />
   </target>

The dist target in "api/build.xml" runs the hibernate-gen target, When
I run the task from the other build file, here's the output:

Buildfile: build.xml

dist:

init:
    [mkdir] Created dir: /home/rafeco/idapi/trunk/api/classes
    [mkdir] Created dir: /home/rafeco/idapi/trunk/api/deploy

compile:
    [javac] Compiling 340 source files to /home/rafeco/idapi/trunk/api/classes
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

hibernate-gen:
  [xdoclet] Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin

dist:
      [jar] Building jar: /home/rafeco/idapi/trunk/api/deploy/whatever.jar

It should generate all of my mapping files up there (and if I ran the
build in the API directory it would).  Any ideas?

--Rafe

-------------------------------------------------------------------------
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-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to