小编moo*_*t94的帖子

为什么我的 import.sql 文件没有自动运行?

正在开发 java spring boot 应用程序。我们的 postgres 数据库是容器化的。我可以让 hibernate 自动创建表,但无法让它自动运行 import.sql 文件。你能帮我弄清楚发生了什么事吗?

这是 build.gradle 文件:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath('org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE')
    }
}


apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

mainClassName = 'idealab.IdeaLabMain'

bootJar {
    baseName = 'idealab'
    excludeDevtools = false //TODO(e-carlin): In production this should be removed
}

repositories {
    mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile('org.springframework.boot:spring-boot-devtools') // TODO(e-carlin): Make sure this …
Run Code Online (Sandbox Code Playgroud)

postgresql hibernate gradle docker spring-boot

4
推荐指数
1
解决办法
2286
查看次数

标签 统计

docker ×1

gradle ×1

hibernate ×1

postgresql ×1

spring-boot ×1