Java 在eclipse中从springboot运行liquibase
我在eclipse中运行spring boot应用程序:Java 在eclipse中从springboot运行liquibase,java,eclipse,spring-boot,liquibase,Java,Eclipse,Spring Boot,Liquibase,我在eclipse中运行spring boot应用程序: @SpringBootApplication public class StatBasketServerApplication { public static void main(String[] args) { SpringApplication.run(StatBasketServerApplication.class, args); } } 属性文件: spring.jpa.hibernate.d
@SpringBootApplication
public class StatBasketServerApplication {
public static void main(String[] args) {
SpringApplication.run(StatBasketServerApplication.class, args);
}
}
属性文件:
spring.jpa.hibernate.ddl-auto=none
spring.h2.console.enabled=true
spring.datasource.url= jdbc:postgresql://localhost:5432/
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.jpa.hibernate.ddl-auto=create-drop
当应用程序启动时,不会进行液化更改
我需要在gradle版本中做些什么吗?如果我看一下控制台,我看不到任何关于liquibase的信息
变更日志在里面
resources/db/changelog.xml
更新
这是我的构建文件
buildscript {
ext {
springBootVersion = '1.4.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
jar {
baseName = 'statBasketServer'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-data-solr")
compile("org.springframework.boot:spring-boot-starter-hateoas")
compile("org.json:json:20141113")
compile("org.postgresql:postgresql:9.4-1201-jdbc4")
compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.6.1")
compile("org.codehaus.woodstox:woodstox-core-asl:4.4.1")
compile group: 'org.postgresql', name: 'postgresql', version: '9.4.1211.jre7'
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("com.jayway.jsonpath:json-path-assert:0.8.1")
}
org.liquibase:liquibase-core
添加到您的类路径中db/changelog/db.changelog master.yaml
作为默认更改日志,或者您可以通过application.properties
中的liquibase.change log
对其进行配置,spring boot还支持xml、json liquibase脚本是spring boot提供的一个示例,您可以参考它,一点是这个示例使用maven作为构建工具。我想您可以进一步澄清,如果您这样提到它,我们看不到更改日志。但这不是更改集的问题,相同的更改集在其他应用程序中运行,这是一个启动问题。当springboot启动时,控制台中不会显示liquibase消息。第一点:我认为它已经准备好包含gradle依赖项了,还是没有?@mautrok也许你需要自己配置它,Huang是的,我读过它来获得帮助,但是buil在maven中,我有gradle。我将尝试查看liquibase是否不在类路径中。添加它的是eaiser
compile('org.liquibase:liquibase-core')
是的,很抱歉,在我编写构建的那一刻,我立即看到了我的错误,但我不知道它是否有效,我正在尝试