Hi everybody,
I have a problem with 'includeAll' when running liquibase via liquibase-maven-plugin 3.5.3.
An example is attached as zip-file shows exactly our use case.It can be executed with the command mvn liquibase:update
It produces the following error:
- [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:update (default-cli) on project liquibase-test: Error setting up or running Liquibase: liquibase.exception.SetupException: Cannot find base path 'changelogFiles/master-file.xml' -> [Help
- org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:update (default-cli) on project liquibase-test: Error setting up or running Liquibase: liquibase.exception.SetupException: Cannot find base path 'changelogFiles/master-file.xml'
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
- at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
- at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
- at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
- at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
- at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
- at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
- at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
- Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: liquibase.exception.SetupException: Cannot find base path 'changelogFiles/master-file.xml'
- at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:398)
- at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
- ... 20 more
- Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Cannot find base path 'changelogFiles/master-file.xml'
- at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27)
- at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
- at liquibase.Liquibase.update(Liquibase.java:202)
- at liquibase.Liquibase.update(Liquibase.java:192)
- at liquibase.Liquibase.update(Liquibase.java:335)
- at org.liquibase.maven.plugins.LiquibaseUpdate.doUpdate(LiquibaseUpdate.java:33)
- at org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo.performLiquibaseTask(AbstractLiquibaseUpdateMojo.java:30)
- at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:394)
- ... 22 more
- Caused by: liquibase.exception.SetupException: Cannot find base path 'changelogFiles/master-file.xml'
- at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:448)
- at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:352)
- at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:282)
- at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
- ... 29 more
- Caused by: liquibase.exception.UnexpectedLiquibaseException: Cannot find base path 'changelogFiles/master-file.xml'
- at liquibase.resource.AbstractResourceAccessor.convertToPath(AbstractResourceAccessor.java:145)
- at liquibase.resource.ClassLoaderResourceAccessor.list(ClassLoaderResourceAccessor.java:61)
- at org.liquibase.maven.plugins.MavenResourceAccessor.list(MavenResourceAccessor.java:29)
- at liquibase.resource.CompositeResourceAccessor.list(CompositeResourceAccessor.java:40)
- at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:425)
We tried some debugging and found out, that the error is thrown when trying to access to the file system via MavenResourceAccessor to target/classes/...
For us it sounds like a bug, but maybe we misunderstand something and it is a feature. Can anyone please help us with that problem.
Running liquibase via commandline would be a workaround for us, but this would lead in higher maintenance-effort for us. So we would prefer to execute it via maven directly in our build.