gpt4 book ai didi

spring-boot - Spring Boot 和 Flyway : file location with spring. flyway.locations 被忽略

转载 作者:行者123 更新时间:2023-12-04 03:04:05 27 4
gpt4 key购买 nike

Spring Boot 1.5.11、Flyway 5.0.7(也试过 5.1.1)。忽略位置规范。我在这里缺少什么?

spring:
profiles: db_h2
datasource:settings
platform: h2
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:log4jdbc:h2:mem:TEST;DB_CLOSE_ON_EXIT=FALSE
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
hikari:
maximum-pool-size: 5
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
flyway:
locations: classpath:/flyway/h2,classpath:/flyway/common,classpath:/flyway/testdata
h2:
console:
enabled: true
path: /h2

日志摘录显示选择了正确的配置文件,但指定的设置不是:
2018-06-05 08:24:48.282 DEBUG 13188 --- [           main] c.c.c.backend.config.Application         : Running with Spring Boot v1.5.11.RELEASE, Spring v5.0.5.RELEASE
2018-06-05 08:24:48.282 INFO 13188 --- [ main] c.c.c.backend.config.Application : The following profiles are active: db_h2,logging_normal,http_insecure,credentials_insecure,option_create_sql_script
2018-06-05 08:24:52.240 INFO 13188 --- [ main] o.f.core.internal.util.VersionPrinter : Flyway Community Edition 5.0.7 by Boxfuse
2018-06-05 08:24:52.414 INFO 13188 --- [ main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:h2:mem:TEST (H2 1.4)
2018-06-05 08:24:52.431 DEBUG 13188 --- [ main] jdbc.sqltiming : com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
1. CALL SCHEMA()
{executed in 5 msec}
2018-06-05 08:24:52.445 DEBUG 13188 --- [ main] org.flywaydb.core.Flyway : DDL Transactions Supported: false
2018-06-05 08:24:52.447 DEBUG 13188 --- [ main] org.flywaydb.core.Flyway : Schema: PUBLIC
2018-06-05 08:24:52.452 DEBUG 13188 --- [ main] o.f.core.internal.util.FeatureDetector : Spring Jdbc available: true
2018-06-05 08:24:52.454 DEBUG 13188 --- [ main] o.f.c.i.c.SqlScriptFlywayCallback : Scanning for SQL callbacks ...
2018-06-05 08:24:52.455 DEBUG 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Scanning for classpath resources at 'classpath:db/migration' (Prefix: '', Suffixes: '.sql')
2018-06-05 08:24:52.455 DEBUG 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Determining location urls for classpath:db/migration using ClassLoader sun.misc.Launcher$AppClassLoader@18b4aac2 ...
2018-06-05 08:24:52.506 WARN 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Unable to resolve location classpath:db/migration

最佳答案

来自 Spring Boot 1.5 documentation我会说正确的属性名称是 flyway.locations , 没有 spring字首。它在 1.5 和 2.0 分支之间有所不同。

关于spring-boot - Spring Boot 和 Flyway : file location with spring. flyway.locations 被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50693549/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com