includeAll relativeToChangelogFile="true" doesn't work

Description

If we call liquibase.update() from an application, we got an exception.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.Liquibase.update(Liquibase.java:181) at liquibase.Liquibase.update(Liquibase.java:174) at de.ids.en.client.integrationtests3.test.AbstractLiquiBasedTestHelper.setUpDatabase(AbstractLiquiBasedTestHelper.java:37) at de.ids.en.client.integrationtests3.test.GenericEntityTemplateTest.setUp(GenericEntityTemplateTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:247) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 30 more Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:353) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:245) ... 32 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:331) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:261) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 34 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:324) ... 37 more

That is our call:

1 2 3 4 ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor(); Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update("");

And this is our workaround:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor() { @Override public Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive) throws IOException { relativeTo = FilenameUtils.getFullPath(relativeTo); return super.list(relativeTo, path, includeFiles, includeDirectories, recursive); } }; Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update("");

The Problem is the path won't correct created.

Environment

Win7, jdk7,eclipse, maven 3.0.5

Status

Assignee

Unassigned

Reporter

idsettlingen

Labels

None

Fix versions

Affects versions

3.3.0

Priority

Major