在gradle中为liquibase更新任务设置自定义.properties文件
我将此任务用于liquibase更新:在gradle中为liquibase更新任务设置自定义.properties文件,gradle,liquibase,Gradle,Liquibase,我将此任务用于liquibase更新: task liquibaseUpdate(type: JavaExec) { description 'Liquibase updates DB by all not used changesets' group = 'Liquibase' classpath configurations.liquibase main = 'liquibase.integration.commandline.Main' if (
task liquibaseUpdate(type: JavaExec) {
description 'Liquibase updates DB by all not used changesets'
group = 'Liquibase'
classpath configurations.liquibase
main = 'liquibase.integration.commandline.Main'
if (
project.hasProperty("username") &&
project.hasProperty("password") &&
project.hasProperty("url")
) {
Map<String,?> propertyMap = project.getProperties()
args "--username=${propertyMap['username']}"
args "--password=${propertyMap['password']}"
args "--url=${propertyMap['url']}"
}
args 'update'
}
task liquibaseUpdate(类型:JavaExec){
说明“通过所有未使用的变更集液化数据库更新”
组='Liquibase'
classpath配置.liquibase
main='liquibase.integration.commandline.main'
如果(
project.hasProperty(“用户名”)&&
project.hasProperty(“密码”)&&
project.hasProperty(“url”)
) {
Map propertyMap=project.getProperties()
args”--username=${propertyMap['username']}
args”--密码=${propertyMap['password']}
args”--url=${propertyMap['url']}
}
args“更新”
}
它从liquibase.properties
文件加载设置。如何使用自定义属性文件?您可能需要的是--defaultsFile=
开关。请看一看