1 Star 0 Fork 2

robin/liquibase-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 4.52 KB
一键复制 编辑 原始数据 按行查看 历史
youngboy 提交于 2019-08-15 16:22 . 添加回滚内容,修改gradle配置
buildscript {
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
mavenCentral()
jcenter()
maven { url "http://repo.spring.io/plugins-release" }
maven { url "http://repo.spring.io/milestone" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}"
classpath "io.spring.gradle:propdeps-plugin:0.0.10.RELEASE"
classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.5.2"
classpath("gradle.plugin.org.liquibase:liquibase-gradle-plugin:2.0.0") {
exclude(module: 'liquibase-core')
}
}
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.liquibase.gradle" // 应用liquibase 插件
group 'vip.youngboy'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/spring/'}
jcenter()
maven { url 'http://repo.spring.io/milestone' }
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'https://repository.jboss.org/nexus/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'http://repo.maven.apache.org/maven2' }
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.liquibase:liquibase-core"
compile "com.h2database:h2"
compileOnly "org.projectlombok:lombok:${lombok_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
testCompile group: 'junit', name: 'junit', version: '4.12'
liquibaseRuntime "org.liquibase:liquibase-core"
liquibaseRuntime files("libs/liquibase-cmd.jar")
liquibaseRuntime "com.h2database:h2"
}
if(!new File("$projectDir/src/main/resources/config/liquibase/diff/").exists()){
new File("$projectDir/src/main/resources/config/liquibase/diff/").mkdir()
}
if(!new File("$projectDir/src/main/resources/config/liquibase/sql/").exists()){
new File("$projectDir/src/main/resources/config/liquibase/sql/").mkdir()
}
project.ext.diffChangelogFile = "$projectDir/src/main/resources/config/liquibase/diff/" + new Date().format('yyyyMMddHHmmss') + '_changelog.xml'
project.ext.generateSql = "$projectDir/src/main/resources/config/liquibase/sql/" + new Date().format('yyyyMMddHHmmss') + '_update.sql'
project.ext.initSql = "$projectDir/src/main/resources/config/liquibase/sql/" + new Date().format('yyyyMMddHHmmss') + '_init.sql'
liquibase {
activities {
prod {
driver 'org.h2.Driver'
changeLogFile 'config/liquibase/changelog/master.xml'
url 'jdbc:h2:file:./build/h2db/db/liquibase;DB_CLOSE_DELAY=-1'
username 'sa'
password ''
outputFile project.ext.generateSql
baseDir "$projectDir/src/main/resources/"
}
dev {
changeLogFile 'config/liquibase/changelog/master.xml'
driver 'org.h2.Driver'
url 'jdbc:h2:file:./build/h2db/db/liquibase;DB_CLOSE_DELAY=-1'
username 'sa'
password ''
outputFile project.ext.generateSql
baseDir "$projectDir/src/main/resources/"
}
reset {
driver 'org.h2.Driver'
changeLogFile "$projectDir/src/main/resources/config/liquibase/changelog/${new Date().format('yyyyMMddHHmmss')}-initial_schema.xml"
url 'jdbc:h2:file:./build/h2db/db/liquibase;DB_CLOSE_DELAY=-1'
username 'sa'
password ''
outputFile project.ext.initSql
baseDir "$projectDir/src/main/resources/"
}
dbDoc {
driver 'org.h2.Driver'
changeLogFile "config/liquibase/changelog/master.xml"
url 'jdbc:h2:file:./build/h2db/db/liquibase;DB_CLOSE_DELAY=-1'
username 'sa'
password ''
outputFile project.ext.generateSql
baseDir "$projectDir/src/main/resources/"
}
}
runList = project.properties.getOrDefault("runList","prod")
mainClassName = 'vip.youngboy.liquibase.LiquibaseApp'
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/bestnewcoding_admin/liquibase-demo.git
git@gitee.com:bestnewcoding_admin/liquibase-demo.git
bestnewcoding_admin
liquibase-demo
liquibase-demo
master

搜索帮助