我正在尝试用 Java 代码模拟 Ant 的“updateDatabase”任务:
Main.main( new String[]{"--defaultsFile=db/properties/db.test.properties --logLevel=debug update"} );
首先,我找不到 updateDatabase 命令。我试过:update, updateSQL,
但我一直在:
Errors:
Command not passed
我的 db.test.properties 文件如果有帮助的话:
#liquibase.properties
driver: org.hsqldb.jdbcDriver
url: jdbc:hsqldb:mem:datasourcedb
username: TEST
password: TEST
changeLogFile: db/changelog/db.changelog-master.xml
我使用“:”符号作为属性文件中的分隔符,如 liquibase.properties 中所述
我做错了什么?请帮忙。
最佳答案
使用单独的字符串而不是一个大字符串:
Main.main( new String[]{
"--defaultsFile=db/properties/db.test.properties",
"--logLevel=debug",
"update"
} );
关于java - 在 java 代码中运行 liquibase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7580041/