Gradle - hibernate tool not working -
i'm trying create task convert cfg sql , i'm using hibernate 3.
my ant task same looks -
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 following dependencies same -
dependencies { 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 -
plugin: id "org.hibernate.gradle.tools" version "1.2.3"
set configuration -
configurations { hibernatetool }
i'm getting following error while running task -
[ant:hibernatetool] slf4j: failed load class "org.slf4j.impl.staticloggerbinder". [ant:hibernatetool] slf4j: defaulting no-operation (nop) logger implementation [ant:hibernatetool] slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details.
here stack trace same -
caused by: java.lang.classnotfoundexception: org.apache.commons.logging.logfactory @ org.apache.tools.ant.antclassloader.findclassincomponents(antclassloader.java:1366) @ org.apache.tools.ant.antclassloader.findclass(antclassloader.java:1315) @ org.apache.tools.ant.antclassloader.loadclass(antclassloader.java:1068) @ java.lang.classloader.loadclass(classloader.java:357) ... 165 more
any leads on appreciated.
adding following dependencies should fix mentioned issue related slf4j.
hibernatetool group: 'org.slf4j', name: 'slf4j-simple', version: '1.6.6'
hibernatetool group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.6.6'
it required add log4j dependency in order fix java.lang.noclassdeffounderror: org/apache/log4j/priority error.
hibernatetool group: 'log4j', name: 'log4j', version: '1.2.17'
Comments
Post a Comment