I’m trying to create a task to convert cfg to sql and I’m using hibernate 3.
My ant task for same looks like this -
ant {
taskdef(name: ‘hibernateTool’,
classname: ‘org.hibernate.tool.ant.HibernateToolTask’,
classpath: configurations.hibernatetool.asPath
)
hibernateTool(destdir: ‘resources/b2c/hibernate/schema’) {
annotationconfiguration(configurationfile: ‘resources/b2c/hibernate/hibernate.b2c.cfg.xml’)
hbm2ddl(export: true, outputfilename: ‘db-b2c-update-ddl.sql’)
classpath {
pathelement(path: ‘classes’)
fileset(dir: ‘…/intl_lib’) {
include(name: ‘**/*.jar’)
}
}
}
}
I have added the following dependencies for the same -
hibernatetool group: ‘org.hibernate’, name: ‘hibernate-tools’, version: '3.2.4.GA’
hibernatetool group: ‘org.hibernate’, name: ‘hibernate-entitymanager’, version: ‘3.6.10.Final’
Applied plugin -
id “org.hibernate.gradle.tools” version “1.2.3”
Set configuration as -
configurations {
hibernatetool
}
I’m getting the following error while running the task -
[ant:hibernateTool] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
[ant:hibernateTool] SLF4J: Defaulting to no-operation (NOP) logger implementation
[ant:hibernateTool] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Here is the stack trace for the same -
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1366)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1315)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1068)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 165 more
Any leads on this is appreciated.
Thanks
Rohit