Liquibase includeAll во встроенных файлах jarJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Liquibase includeAll во встроенных файлах jar

Сообщение Anonymous »

Я столкнулся со следующей проблемой. У меня есть проект на Java 17, Spring Boot 3.2.0. Пробовал разные версии Liquibase 4.29.2/5.0.1. Проект состоит из трех модулей, два из которых независимы друг от друга, а третий - модуль ядра, который используется как зависимость в двух независимых модулях, сделанных как стартовый.
Каждый проект имеет свой журнал изменений, который содержит includeAll, который просматривает каталог со скриптами для себя и включаемый файл с путем к файлу журнала изменений третьего модуля (ядро, которое также является зависимостью).
В файле журнала изменений есть includeAll с путем к каталогу со скриптами, общими для двух других модулей.
Я запускаю миграцию через CLI с помощью этой команды:

Код: Выделить всё

java -cp "my-app-1.jar" "-Dloader.main=liquibase.integration.commandline.LiquibaseCommandLine"  org.springframework.boot.loader.launch.PropertiesLauncher --driver=org.postgresql.Driver --changeLogFile=com/my-app1/liquibase/changelog.xml --url=jdbc:postgresql://localhost:5432/db --username=db --password=password update
После запуска я получаю сообщение об ошибке:

Код: Выделить всё

[2026-02-10 13:16:55] FINE [liquibase.changelog] Using file opener for includeAll: SearchPathResourceAccessor{}
[2026-02-10 13:16:55] FINE [liquibase.resource] Path liquibase/changelog/ in build\libs does not exist (liquibase.resource.DirectoryResourceAccessor (build\libs))
[2026-02-10 13:16:55] FINE [liquibase.resource] Creating resourceAccessor for file build\libs\my-app1.jar/!BOOT-INF/lib/embeded-jar.jar
[2026-02-10 13:16:55] INFO [liquibase.command] Logging exception.
ERROR: Exception Details
[2026-02-10 13:16:55] INFO [liquibase.ui] ERROR: Exception Details
ERROR: Exception Primary Class:  IOException
[2026-02-10 13:16:55] INFO [liquibase.ui] ERROR: Exception Primary Class:  IOException
ERROR: Exception Primary Reason: Could not find/read changelogs from liquibase/changelog directory
[2026-02-10 13:16:55] INFO [liquibase.ui] ERROR: Exception Primary Reason: Could not find/read changelogs from liquibase/changelog directory
ERROR: Exception Primary Source: PostgreSQL 15.1 (Debian 15.1-1.pgdg110+1)
[2026-02-10 13:16:55] INFO [liquibase.ui] ERROR: Exception Primary Source: PostgreSQL 15.1 (Debian 15.1-1.pgdg110+1)
[2026-02-10 13:16:55] INFO [liquibase.command] Command execution complete
[2026-02-10 13:16:55] SEVERE [liquibase.integration] Could not find/read changelogs from embeded/core/liquibase/changelog directory
liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.command.CommandScope.execute(CommandScope.java:253)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:55)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:24)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$2(LiquibaseCommandLine.java:391)
at liquibase.Scope.child(Scope.java:195)
at liquibase.Scope.child(Scope.java:171)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$3(LiquibaseCommandLine.java:366)
at liquibase.Scope.child(Scope.java:195)
at liquibase.Scope.child(Scope.java:171)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:363)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:103)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
at org.springframework.boot.loader.launch.PropertiesLauncher.main(PropertiesLauncher.java:574)
Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException:  Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.lambda$getDatabaseChangeLog$0(DatabaseChangelogCommandStep.java:129)
at liquibase.Scope.child(Scope.java:195)
at liquibase.Scope.child(Scope.java:171)
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.getDatabaseChangeLog(DatabaseChangelogCommandStep.java:128)
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.run(DatabaseChangelogCommandStep.java:87)
at liquibase.command.CommandScope.execute(CommandScope.java:217)
... 25 more
Caused by: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:465)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:390)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
... 31 more
Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:951)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:455)
... 33 more
Caused by: liquibase.exception.SetupException: Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.changelog.DatabaseChangeLog.findResources(DatabaseChangeLog.java:833)
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:741)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:508)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:390)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
... 35 more
Caused by: java.io.IOException: Could not find/read changelogs from embeded/core/liquibase/changelog directory
at liquibase.changelog.DatabaseChangeLog.findResources(DatabaseChangeLog.java:815)
... 39 more
P.S. include-файл работает без проблем, но выглядит это не очень хорошо, так как я не хочу заходить в журнал изменений каждый раз, когда добавляю новый скрипт и добавляю еще одну строчку. И это работает в проекте с jmix

Подробнее здесь: https://stackoverflow.com/questions/798 ... -jar-files
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»