I use JBuilder 8 as my IDE, which has Ant 1.5.1, but Ant is not it's default build facility, so I've never had the fortune of using Ant or XDoclet before.
That being said, I'm posting here, rather than in the tools forum :-)
First off, I'm noticing that Ant xml files, when Ant is invoked by JBuilder, do not seem to get passed pretty much any of the default variables you always see in Ant scripts (${lib.dir}, etc)
So in order to get it to work, I had to set alot of these variables myself. Fine Fine...
So the Ant script runs without complaining, but it does not generate ANY hbm.xml files. I've tweaked the script to look for a *single* boring hibernated java class, and still no joy.
I know Ant is finding my source files because it warns me about a Class reference that wasn't fully qualified (guessing correctly that it was in the same package as the current class). I removed that class reference, and didn't get the complaint, but got no hbm.xml files either. (Fwiw, when I change the build script to have a mispelled class name, Ant again does not complain.
Here's my ant build xml file and resulting messages from Ant.
Anyone see any obvious flaws? Advice?
TIA
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="bb" default="generate-hibernate" basedir=".">
<property name="src.dir" value=".\src\bb\model" />
<property name="hibernate.dir" value=".\src\bb\model\tmp" />
<property name="merge.dir" value=".\src\bb\model" />
<property name="xdoclet.lib.dir" value="C:\jbuilder8\thirdparty\xdoclet-1.2\lib" />
<property name="lib.dir" value="C:\jbuilder8\lib" />
<path id="xdoclet.lib.path">
<fileset dir="${xdoclet.lib.dir}" includes="*.jar"/>
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="generate-hibernate">
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask"
classpathref="xdoclet.lib.path" />
<!-- Generate Hibernate mapping files -->
<hibernatedoclet destdir="${hibernate.dir}"
mergeDir="${hibernate.dir}">
<fileset dir="${src.dir}">
<include name="Transaction.java" />
</fileset>
<hibernate version="2.0" />
</hibernatedoclet>
</target>
</project>
Code:
Apache Ant version 1.5.1 compiled on October 2 2002
Buildfile: build-hibernate.xml
Detected Java version: 1.4 in: C:\JBuilder8\jdk1.4\jre
Detected OS: Windows XP
parsing buildfile build-hibernate.xml with URI = file:C:/Documents and Settings/critter/jbproject/bb/build-hibernate.xml
Project base dir set to: C:\Documents and Settings\critter\jbproject\bb
Build sequence for target `generate-hibernate' is [generate-hibernate]
Complete build sequence is [generate-hibernate]
generate-hibernate:
[hibernatedoclet] (ModuleFinder.findModules 179 ) There is an entry on XDoclets classpath that doesn't exist: {0}. Ignoring it
[hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/>
[hibernatedoclet] INFO: Some classes refer to other classes that were not found among the sources or on the classpath.
[hibernatedoclet] (Perhaps the referred class doesn't exist? Hasn't been generated yet?)
[hibernatedoclet] The referring classes do not import any fully qualified classes matching these classes.
[hibernatedoclet] However, since no packages are imported, xjavadoc has assumed that the referred classes
[hibernatedoclet] belong to the same package as the referring class. The classes are:
[hibernatedoclet] C:\Documents and Settings\critter\jbproject\bb\src\bb\model\Transaction.java --> Auditable qualified to bb.model.Auditable
[hibernatedoclet] C:\Documents and Settings\critter\jbproject\bb\src\bb\model\Transaction.java --> Auditable qualified to bb.model.Auditable
BUILD SUCCESSFUL
Total time: 3 seconds