spring-boot - Spring Boot Starter Data JPA - liquibase 错误
问题描述
我正在尝试使用 Spring Boot 中的 JPA 启动器创建一个 postgres 数据库。我有一个简单的实体。
@Entity
@Table(name = "project")
data class Project(
val name: String,
val url: String,
val owner: String,
val language: Language,
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
val id: Long? = null,
val description: String? = null,
@ElementCollection
val tags: List<String> = listOf(),
val license: String? = null
)
enum class Language {
KOTLIN, JAVASCRIPT, JAVA
}
我的 application.properties 中有这个
logging.level.com.project=DEBUG
spring.datasource.url=jdbc:postgresql://localhost:5432/db
spring.datasource.username=user
spring.datasource.password=password
spring.jpa.generate-ddl=true
我的模块的gradle文件:
apply plugin: 'kotlin-spring'
apply plugin: "kotlin-jpa"
apply plugin: 'kotlin'
dependencies {
compile("org.springframework.boot:spring-boot-starter:$spring_boot_version")
compile("org.springframework.boot:spring-boot-starter-data-jpa:$spring_boot_version")
compile("org.postgresql:postgresql:$postgres_version")
}
当 Igo 运行服务器时,我得到:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration':
但我不使用 liquibase?预期的行为应该是spring在postgresql中生成我的表
解决方案
通过添加修复
spring.liquibase.enabled=false
到配置
推荐阅读
- angular - 输入装饰器值未通过 - 未定义值
- javascript - 如何将 JSON 对象冒号 (:) 转换为等于 (=)
- ios - 使用 SwiftUI 和 contentMode = .aspectFit 动态裁剪图像
- java - 如果 SpEL 执行失败,如何在 Java 中跳过 PreAuthorize?
- java - 受保护的方法与受保护的属性
- javascript - HH:MM 时间格式 RegEx 数组内
- neural-network - 将具有 ReLU 的神经网络拟合到多项式函数
- pointers - 如果我将成员函数指针置于指针实例范围之外,是否有任何问题
- python - 如何使用我的按钮在模式之间切换
- flutter - 如何减少 IntelliJ IDEA 中的颤振发布 apk 大小?