The XDoclet tool is not generating the hbm.xml files.
Here is what I did:
I downloaded xdoclet-1.2.2-SNAPSHOT
In my src foler, I put the:
xdoclet-1.2.2-SNAPSHOT\docs\ant\xdoclet folder
so now there's an src\xdoclet folder
In my lib directory I created a folde called xdoclet and in it I put the *.jar files from the xdoclet-1.2.2-SNAPSHOT\lib folder.
In my classpath I included the tools.jar file from my C:\j2sdk1.4.2_04\lib
in my CLASSPATH.
I also dl ANT and created a System environment variable called ANT_HOME with the C:\apache-ant-1.6.2-bin
In my PATH environemtn variable I included
%ANT_HOME%\bin
It does not seem like the HibernateDoclet is generating hbm.xml files.
Here is my build.xml file:
<?xml version="1.0"?>
<project name="test" default="compile" basedir=".">
<property name="source.root" value="src"/>
<property name="class.root" value="classes"/>
<property name="lib.dir" value="lib"/>
<property name="generated.home" value="generated"/>
<!-- Set up the class path for compilation and execution -->
<path id="project.class.path">
<!-- Include our own classes, of course -->
<pathelement location="${class.root}" />
<!-- Include jars in the project library directory -->
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path="${class.root}"/>
</path>
<path id="xdoclet.lib.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.dir}/xdoclet">
<include name="*.jar"/>
</fileset>
</path>
<!-- Create our runtime subdirectories and copy resources into them -->
<target name="prepare" description="Sets up build structures">
<mkdir dir="${class.root}"/>
<mkdir dir="${generated.home}"/>
<!-- Copy our property files and O/R mappings for use at runtime -->
<copy todir="${class.root}" >
<fileset dir="${source.root}" >
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!-- Compile the java source of the project -->
<target name="compile" depends="prepare"
description="Compiles all Java classes">
<javac srcdir="${source.root}"
destdir="${class.root}"
debug="on"
optimize="off"
deprecation="on"
classpathref="project.class.path">
<classpath>
<path refid="project.class.path"/>
<pathelement location="${class.root}"/>
</classpath>
</javac>
</target>
<target name="generate" description="Generates Hibernate class descriptor files." depends="compile">
<!-- Define the hibernatedoclet task -->
<taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask" classpathref="xdoclet.lib.path"/>
<!-- Execut the hibernatedoclet task -->
<hibernatedoclet
destdir="${generated.home}"
excludedtags="@version,@author,@todo"
force="${generated.forced}"
mergedir="${generated.home}"
verbose="false">
<fileset dir="${source.root}">
<include name="**/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet>
</target>
</project>
When I type: 'ant generate' into the command line
I get:
C:\hibernate-2.1\practice9>ant generate
Buildfile: build.xml
prepare:
[mkdir] Created dir: C:\hibernate-2.1\practice9\classes
[mkdir] Created dir: C:\hibernate-2.1\practice9\generated
[copy] Copying 3 files to C:\hibernate-2.1\practice9\classes
compile:
[javac] Compiling 2 source files to C:\hibernate-2.1\practice9\classes
generate:
[hibernatedoclet] log4j:WARN No appenders could be found for logger (xdoclet.uti
l.Translator.getString).
[hibernatedoclet] log4j:WARN Please initialize the log4j system properly.
BUILD SUCCESSFUL
Total time: 14 seconds
So it BUILDS SUCCESSFUL but there is no hbm.xml files generated.
Why would that be?
Thank you,
John
|