Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

includeAll cannot process directories in embedded jar files #2352

Closed
hayeskl opened this issue Jan 10, 2022 · 2 comments · Fixed by #5340
Closed

includeAll cannot process directories in embedded jar files #2352

hayeskl opened this issue Jan 10, 2022 · 2 comments · Fixed by #5340

Comments

@hayeskl
Copy link
Contributor

hayeskl commented Jan 10, 2022

Environment

Grails 5.0.3

Liquibase Version:
4.6.2

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>
Core

Liquibase Extension(s) & Version:

Database Vendor & Version:

Operating System Type & Version:
Mac Monterey 12.1

Description

A clear and concise description of the issue being addressed.
When running the application as a jar file the migrations are not found. The following error is returned:

liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'current/'
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:553)
at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:409)
at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:318)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:23)
... 96 more
Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'current/'
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:544)
... 99 more

Steps To Reproduce

Package migrations into jar file relative to changeLogFile
Build a spring bootable jar for application and include the jar with migrations
run the spring bootable jar

Actual Behavior

The above exception is thrown because ClassLoaderResourceAccessor cannot parse the resource path:
jar:file:/Users/khayes/griffin.git/trifleet/build/libs/trifleet-12.0.0.jar!/BOOT-INF/lib/common-12.0.0-plain.jar!/current/

Expected/Desired Behavior

Migrations should be loaded from the embedded jar file

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

@hayeskl
Copy link
Contributor Author

hayeskl commented Jan 10, 2022

This issue is fixed with #2353

@hayeskl
Copy link
Contributor Author

hayeskl commented Nov 10, 2023

I've confirmed that this issue still exists with liquibase 4.24.0.

@kevin-atx kevin-atx added this to the Epic: Path Issues milestone Dec 5, 2023
filipelautert pushed a commit that referenced this issue Jan 12, 2024
fixed issue 2352 by adding support for loading embedded jar files

Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
Co-authored-by: rberezen <ruslan.berezenskyi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment