Java I';m无法使用Liquibase生成初始更改日志
我将使用shell中的Liquibase 3.1.0,从项目包info.ggiv.cdr.commons.entity.*中的javax.persistence注释类生成初始更改日志。我已经将mysql连接器和liquibase-hibernate4库放在我的liquibase安装的lib目录中。 Hibernate 3.4.0的库位于/opt/java lib/Hibernate orm/lib/all文件夹中: 当我使用以下命令启动Luquibase时Java I';m无法使用Liquibase生成初始更改日志,java,hibernate,liquibase,Java,Hibernate,Liquibase,我将使用shell中的Liquibase 3.1.0,从项目包info.ggiv.cdr.commons.entity.*中的javax.persistence注释类生成初始更改日志。我已经将mysql连接器和liquibase-hibernate4库放在我的liquibase安装的lib目录中。 Hibernate 3.4.0的库位于/opt/java lib/Hibernate orm/lib/all文件夹中: 当我使用以下命令启动Luquibase时 gg@VM-WrkEnv:~/Proj
gg@VM-WrkEnv:~/Projektek/CDR/src/CDR-Commons/src/main/java$ /opt/liquibase/liquibase --changeLogFile=/home/gg/Projektek/CDR/src/CDR-Commons/src/main/resources/changelog.xml --referenceUrl=hibernate:spring:info.ggiv.cdr.commons.entity.account,info.ggiv.cdr.commons.entity.contact,info.ggiv.cdr.commons.entity.descriptor.ds,info.ggiv.cdr.commons.entity.descriptor.ds.entry.field,info.ggiv.cdr.commons.entity.ds,info.ggiv.cdr.commons.entity.ds.entry,info.ggiv.cdr.commons.entity.ds.enty.field,info.ggiv.cdr.commons.entity.ds.field.type,info.ggiv.cdr.commons.entity.ds.field.type.simple,info.ggiv.cdr.commons.entity.event,info.ggiv.cdr.commons.entity.localization,info.ggiv.cdr.commons.entity.organization,info.ggiv.cdr.commons.entity.ou,info.ggiv.cdr.commons.entity.owner?dialect=org.hibernate.dialect.MySQL5Dialect --url=jdbc:mysql://localhost/cdr --username=root --password=****** --classpath=/opt/java-lib/hibernate-orm/lib/all generateChangeLog
从源代码所在的文件夹中,我得到以下输出
WARNING 2014.01.13. 18:11:liquibase: Can not use class liquibase.ext.hibernate.database.HibernateSpringDatabase as a Liquibase service because org.hibernate.dialect.Dialect is not in the classpath
WARNING 2014.01.13. 18:11:liquibase: Can not use class liquibase.ext.hibernate.database.HibernateEjb3Database as a Liquibase service because org.hibernate.dialect.Dialect is not in the classpath
WARNING 2014.01.13. 18:11:liquibase: Can not use class liquibase.ext.hibernate.database.HibernateClassicDatabase as a Liquibase service because org.hibernate.dialect.Dialect is not in the classpath
WARNING 2014.01.13. 18:11:liquibase: Can not use class liquibase.ext.hibernate.snapshot.SequenceSnapshotGenerator as a Liquibase service because org.hibernate.id.factory.IdentifierGeneratorFactory is not in the classpath
Liquibase 'generateChangeLog' Successful
并且生成的更改日志文件为空:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"/>
我做错了什么?谢谢 尝试使用此选项:。我认为并不是所有的图书馆都被接受 classpath属性不支持JAR目录,您需要单独包含hibernate JAR 更容易的是,您应该能够将HibernateJAR添加到/opt/liquibase/liquibase中的“lib”目录中。shell脚本将在其中找到所有jar,并将它们添加到类路径中
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"/>