FileSystemResourceAccessor fails with non-hierarchical URLs on class path

Description

FileSystemResourceAccessor fails in FileSystemResourceAccessor#addRootPath() if the JVM class path contains a "non-hierarchical" URL, such as "jar:file:/home/user/.m2/repository/javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar!/META-INF/versions/9/".

The following exception is being thrown:

java.lang.IllegalArgumentException: URI is not hierarchical

at java.base/java.io.File.<init>(File.java:418)
at liquibase.resource.FileSystemResourceAccessor.addRootPath(FileSystemResourceAccessor.java:51)
at liquibase.resource.AbstractResourceAccessor.init(AbstractResourceAccessor.java:39)
at liquibase.resource.FileSystemResourceAccessor.init(FileSystemResourceAccessor.java:44)
at liquibase.resource.FileSystemResourceAccessor.<init>(FileSystemResourceAccessor.java:26)
at com.github.joschi.liquibase.LiquibaseTest.test(LiquibaseTest.java:27)

liquibase-classpath-issue is a minimal project illustrating the issue. The problem can be seen on Travis CI build #394604885.

The "fail" build profile (activated by the environment variable FAIL=true) adds the dependency on javax.xml.bind:jaxb-ap:2.3.0 to the project (and the test class path) which leads to the described issue.

Environment

Java 10.0.1
Liquibase 3.6.1
Maven 3.5.3

Activity

Show:

Vatnajökull February 18, 2019 at 7:59 AM

This fix has been shipped with release 3.6.3.

Baron Roberts December 19, 2018 at 10:15 AM

Is there a blocking issue holding up a release for Java 11 compatibility?

Baron Roberts December 18, 2018 at 8:27 AM

Ping

Baron Roberts December 15, 2018 at 6:00 PM

Please generate a release with this fix, now that it is merged. The current version of Liquibase does not work with Java 11.

Thanks,
Baron

Vatnajökull November 2, 2018 at 2:12 PM

A PR is waiting for review and merge: https://github.com/liquibase/liquibase/pull/830

Details

Reporter

Components

Affects versions

Priority

Created June 20, 2018 at 3:18 PM
Updated February 18, 2019 at 7:59 AM