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

Liquibase fails when changelog file is not the default resource path #41236

Closed
murilo-develop opened this issue Jun 16, 2024 · 8 comments · Fixed by #41530
Closed

Liquibase fails when changelog file is not the default resource path #41236

murilo-develop opened this issue Jun 16, 2024 · 8 comments · Fixed by #41530
Assignees
Milestone

Comments

@murilo-develop
Copy link

murilo-develop commented Jun 16, 2024

Describe the bug

When I try to build a native app which uses Liquibase and the changelog file path is not the default the build fails.

Expected behavior

Native app successfully built.

Actual behavior

The build process fails with a message:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.11.2:build (default) on project liquibase-quickstart: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.liquibase.deployment.LiquibaseProcessor#nativeImageConfiguration threw an exception: java.lang.IllegalStateException: liquibase.exception.ChangeLogParseException: The file local/changeLog.xml was not found in the configured search path:

How to Reproduce?

liquibase-quickstart.zip

  1. Download the liquibase-quickstart.zip.
  2. Unzip it where is most convenient for you.
  3. Go to the folder created.
  4. Open a terminal from there.
  5. Run the command, "./mvnw clean install" (it should run with no errors)
  6. Build a native image using the command, "./mvnw clean package -Dnative"

Output of uname -a or ver

Linux L-PW03AH72 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux

Output of java -version

Picked up JAVA_TOOL_OPTIONS: -Dos.version=arch openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM Zulu17.38+21-CA (build 17.0.5+8-LTS, mixed mode, sharing)

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.11.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

I also tried to add additional resource files through the property "quarkus.native.resources.includes". For instance, "quarkus.native.resources.includes=db/changelog/**". But it also did not work.

However, when I created the file "src/main/resources/local/changeLog.xml" and removed the quarkus property, "quarkus.liquibase.search-path=db/changelog", it worked.

Furthermore, if I let the quarkus's property,"quarkus.liquibase.search-path=db/changelog", in the application.properties file it finds twice the same file and fail.

Therefore, I hope to have the same behavior, once set the quarkus.liquibase.search-path it should be handled in the same way no matter the sort of the build.

Copy link

quarkus-bot bot commented Jun 16, 2024

/cc @Karm (mandrel), @andrejpetras (liquibase), @galderz (mandrel), @geoand (liquibase), @gsmet (liquibase), @zakkak (mandrel)

@murilo-develop murilo-develop changed the title Liquibase fails when changelog file is not the default path Liquibase fails when changelog file is not the default resource path Jun 16, 2024
@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

It seems that quarkus.liquibase.search-path seems to not be taked into account at build time.
@juanjogv as you added this feature, mind taking a look?

Thanks

@juanjogv
Copy link
Contributor

@murilo-develop when you say

When I try to build a native app which uses Liquibase and the changelog file path is not the default the build fails.

as the error shows your change log file name is "changeLog.xml" but is located in a directory named "local", right? the "local" directory is in the classpath or where is it?

@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

It's part of the file system - the attached sample perfectly reproduces the problem being described

@juanjogv
Copy link
Contributor

understood, when I have some time I will take a look at it.

@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

Thanks a lot!

@juanjogv
Copy link
Contributor

@geoand I have just made the adjustment is on this PR

@geoand
Copy link
Contributor

geoand commented Jun 28, 2024

Thanks!

@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jul 3, 2024
@gsmet gsmet modified the milestones: 3.13 - main, 3.12.2 Jul 9, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 9, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants