how to generate .hbm.xml files and .java files using build.xml
it gives me error like build failed
build.xml:30: java.lang.NoClassDefFoundError: org/hibernate/engine/Mapping
my build.xml file is -------------------------------------------------------------------
<?xml version="1.0"?>
<project name="lms" default="" basedir=".">
<property name="resources.dir" value="${basedir}/src/main/resources" /> <property name="java.dir" value="${basedir}/src/main/java" /> <property name="java.domain.core.dir" value="${java.dir}/com/abm/lms/domain/core/demo" /> <property name="java.generator.dir" value="${java.dir}/com/ao2/smart/generator" /> <property name="classes.dir" value="${basedir}/WebContent/WEB-INF/classes" /> <property name="lib.dir" value="${basedir}/WebContent/WEB-INF/lib" /> <property name="tab" value="	" /> <property name="http.proxyHost" value="proxy.RAVI-LENOVO"/> <property name="http.proxyPort" value="8443"/>
<path id="toolslib"> <path location="${lib.dir}/hibernate-core-4.1.0.Final.jar" /> <fileset dir="${lib.dir}"> <include name="*.jar"/> </fileset> </path>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />
<target name="CodeGen.GenerateDomainObjects" depends="CodeGen.AdjustCollections,CodeGen.AddOrphanRemoval,CodeGen.AddSerialVersion, CodeGen.ChildAddMethodInjector"> </target> <!-- Generate hbm.xml and java files --> <target name="CodeGen.RunHibernateTool" description="generate hibernate classes n java classes"> <hibernatetool destdir="${java.dir}">
<jdbcconfiguration configurationfile="${resources.dir}/hibernate.cfg.xml" packagename="com.abm.lms.domain.core.demo" revengfile="${basedir}\hibernate.reveng.xml" detectmanytomany="true" /> <hbm2hbmxml /> <hbm2java jdk5="true" ejb3="true" />
</hibernatetool>
</target>
<!-- Searches and replaces the two regular expressions --> <target name="CodeGen.AdjustCollections">
<replaceregexp byline="true"> <regexp pattern="import java.util.HashSet;" /> <substitution expression="import java.util.ArrayList;" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp>
<replaceregexp byline="true"> <regexp pattern="import java.util.Set;" /> <substitution expression="import java.util.List;" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp>
<replaceregexp byline="true"> <regexp pattern="new HashSet" /> <substitution expression="new ArrayList" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp>
<replaceregexp flags="g"> <regexp pattern="Set<(\w*)>" /> <substitution expression="List<\1>" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp>
</target>
<target name="CodeGen.AddOrphanRemoval"> <replaceregexp byline="true"> <regexp pattern="@OneTo(.*)\)" /> <substitution expression="${tab}@OneTo\1, cascade = javax.persistence.CascadeType.ALL, orphanRemoval = true)" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp> </target> <target name="CodeGen.AddSerialVersion"> <replaceregexp> <regexp pattern="implements java\.io\.Serializable\s*\{" /> <substitution expression="implements java\.io\.Serializable${line.separator}{${line.separator}${tab}private static final long serialVersionUID = 1L;" /> <fileset dir="${java.domain.core.dir}" includes="*.java" /> </replaceregexp> </target> <target name="CodeGen.ChildAddMethodInjector">
<java classname="com.ao2.smart.generator.ChildAddMethodInjector" fork="yes"> <sysproperty key="http.proxyHost" value="${http.proxyHost}" /> <sysproperty key="http.proxyPort" value="${http.proxyPort}" /> <sysproperty key="xslt.file" value="${java.generator.dir}/ChildAddMethodInjector.xsl" /> <sysproperty key="xml.files.dir" value="${java.domain.core.dir}" /> <classpath> <path location="${classes.dir}"/> <path refid="toolslib"/> </classpath> </java> </target> <target name="CodeGen.FieldLabelsProperties">
<java classname="com.ao2.smart.generator.FieldLabelsGenerator" fork="yes"> <sysproperty key="http.proxyHost" value="${http.proxyHost}" /> <sysproperty key="http.proxyPort" value="${http.proxyPort}" /> <sysproperty key="xslt.file" value="${java.generator.dir}/FieldLabelsGenerator.xsl" /> <sysproperty key="xml.files.dir" value="${java.domain.core.dir}" /> <sysproperty key="output.file" value="${resources.dir}/field-labels.properties" /> <classpath> <path location="${classes.dir}"/> <path refid="toolslib"/> </classpath> </java>
</target>
</project> -----------------------------------------
reply soon thanks
|