spring boot - Liquibase could not determine Path - Stack Overflow

So I have liquibase scripts for my spring boot application (3.3.8) liquibase 4.27.0It works if files i

So I have liquibase scripts for my spring boot application (3.3.8) liquibase 4.27.0 It works if files in resource directory.

But my pipeline takes liquibase scripts from root directory /pipeline/dbscripts/liquibase and execute in before deploy.

So, for local development I set path to scripts

spring:
  liquibase:
    enabled: true
    change-log: file:./pipeline/dbscripts/liquibase/db.changelog-master.yaml

But now I get exception:

Caused by: liquibase.exception.UnexpectedLiquibaseException: Could not determine path for 
file:/home/<userDir>/IdeaProjects/project/pipeline/dbscripts/liquibase/changelog/2025/03/202503031455-create-table.yaml

File exists in directory

====

Found extra information

If main chanelog with includeAll => exception

databaseChangeLog:
  - includeAll:
      path: ./changelog
      relativeToChangelogFile: true
  

If it contain only include. it works

databaseChangeLog:
  - include:
      file: ./changelog/2025/03/202503031455-create-table.yaml
      relativeToChangelogFile: true      

So I have liquibase scripts for my spring boot application (3.3.8) liquibase 4.27.0 It works if files in resource directory.

But my pipeline takes liquibase scripts from root directory /pipeline/dbscripts/liquibase and execute in before deploy.

So, for local development I set path to scripts

spring:
  liquibase:
    enabled: true
    change-log: file:./pipeline/dbscripts/liquibase/db.changelog-master.yaml

But now I get exception:

Caused by: liquibase.exception.UnexpectedLiquibaseException: Could not determine path for 
file:/home/<userDir>/IdeaProjects/project/pipeline/dbscripts/liquibase/changelog/2025/03/202503031455-create-table.yaml

File exists in directory

====

Found extra information

If main chanelog with includeAll => exception

databaseChangeLog:
  - includeAll:
      path: ./changelog
      relativeToChangelogFile: true
  

If it contain only include. it works

databaseChangeLog:
  - include:
      file: ./changelog/2025/03/202503031455-create-table.yaml
      relativeToChangelogFile: true      
Share Improve this question edited Mar 4 at 11:32 Shakirov Ramil asked Mar 4 at 11:15 Shakirov RamilShakirov Ramil 1,5541 gold badge12 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I don't believe Liquibase will recurse through a directory structure to look for changelogs includeAll. Since the changelog you are referencing is in ./changelog/2025/03. I would try switching the specification in ./pipeline/dbscripts/liquibase/db.changelog-master.yaml from:

databaseChangeLog:
  - includeAll:
      path: ./changelog
      relativeToChangelogFile: true

to:

databaseChangeLog:
  - includeAll:
      path: ./changelog/2025/03 // <=full relative path to file
      relativeToChangelogFile: true 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745047737a4608198.html

相关推荐

  • spring boot - Liquibase could not determine Path - Stack Overflow

    So I have liquibase scripts for my spring boot application (3.3.8) liquibase 4.27.0It works if files i

    7小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信