在特定的变更集上运行 mvn liquibase:updateSQL
经验丰富的 Maven 用户可能可以在这里帮助我:
当将 liquibase 作为 Maven 目标运行时,如何将“可选参数”传递给 liquibase?
我想传递“changesToApply”,请参阅http://www.liquibase.org/manual/maven_updatesql
但是语法是什么? 类似这样,但不完全是:
mvn liquibase:updateSQL -DchangesToApply=2
Somebody who's a more seasoned maven user can probably help me out here:
how do I pass in "optional parameters" to liquibase when running it as a maven goal?
I want to pass in "changesToApply", see http://www.liquibase.org/manual/maven_updatesql
But what's the syntax?
Something like this, but not quite:
mvn liquibase:updateSQL -DchangesToApply=2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
简短回答:
详细回答
转到您感兴趣的参数并查找其表达式。
http://www.liquibase.org/manual/maven_updatesql#changesToApply
查找
从此 ,你可以看到表达式是
${liquibase.changesToApply}
这就是你应该使用的
Short answer:
Long answer
Go to the parameter you're interested and look for it's expression.
http://www.liquibase.org/manual/maven_updatesql#changesToApply
Look for
From this, you can see the expression is
${liquibase.changesToApply}
That's what you should use
来自 Maven Liquibase 插件手册
From Maven Liquibase plugin manual
我是这样做的:
mvn liquibase:updateSQL -P mysql -DskipTests -Dliquibase.changeLogFile=create.xml
其中我的更改日志文件是“create.xml”
和“mysql”是一个预先配置的配置文件,用于填充我的数据库属性文件。
确保更改日志文件未硬编码在 liquibase.properties 文件中
并确保重建模块,因为 Maven 目标将使用模块的 target/classes 目录中的 liquibase.properties
Here is how I do it:
mvn liquibase:updateSQL -P mysql -DskipTests -Dliquibase.changeLogFile=create.xml
where my change log file is "create.xml"
and "mysql" a pre-configured profile to populate my database properties file.
make sure though that the change log file is not hard coded in the liquibase.properties file
and make sure that you rebuild the module because the maven goal will use the liquibase.properties in the target/classes directory of the module
对于版本 3.5.5 应该在
之外,如下所示:For the version 3.5.5 should go outside
<executions>
like below: