I'm trying to build my first Ibator plugin against the Ibator SVN source,
but when I run Ibator from the ant task, it can't find the
IbatorPluginAdapter class.
I've tried adding the ibator.jar as a classpath entry in the
ibatorConfiguration, but then I run into incompatible classes.
I'm sure it's a pretty straightforward fix, but I'm not sure what I'm doing
wrong.
Thanks for the help,
Dan Turkenkopf
My build.xml looks like this:
<project default="genfiles" basedir=".">
<property name="generated.source.dir" value="${basedir}\output" />
<target name="compile">
<javac srcdir="${basedir}\src" destdir="${basedir}\bin"
classpath="ibator.jar"/>
</target>
<target name="jar" depends="compile">
<jar destfile="${basedir}\plugin.jar" basedir="${basedir}\bin"/>
</target>
<target name="genfiles" depends="jar" description="Generate the files">
<taskdef name="ibator"
classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
classpath="ibator.jar" />
<ibator overwrite="true" configfile="ibator-config.xml"
verbose="false" >
<propertyset>
<propertyref name="generated.source.dir"/>
</propertyset>
</ibator>
</target>
</project>
And my ibator-config.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ibatorConfiguration
PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS ibator
Configuration 1.0//EN"
"http://ibatis.apache.org/dtd/ibator-config_1_0.dtd">
<ibatorConfiguration>
<classPathEntry location="mysql-connector-java-5.0.4-bin.jar" />
<classPathEntry location="plugin.jar" />
<ibatorContext id="TestPlugin">
<ibatorPlugin type="gov.nyhealth.apps.vms.ibator.plugins.SetPlugin" />
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost/DBNAME"
userId="USER_NAME"
password="PASSWORD">
</jdbcConnection>
<javaModelGenerator targetPackage="test.model" targetProject="src">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<sqlMapGenerator targetPackage="test.xml" targetProject="src">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<daoGenerator type="SPRING" targetPackage="test.dao"
targetProject="src">
<property name="enableSubPackages" value="true" />
</daoGenerator>
<table schema="SCHEMA_NAME" tableName="TABLE_NAME" >
<property name="KeyName" value="KEY_COLUMN" />
<property name="SetKeyName" value="SET_KEY_COLUMN" />
<columnOverride column="COLUMN" property="overiddenColumn" />
</table>
</ibatorContext>
</ibatorConfiguration>
|