Uploaded image for project: 'Liquibase Core'
  1. CORE-3386

includeAll can't resolve relativeToChangelogFile path within a jar file

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 3.6.2
    • Fix versions: 3.6.4
    • Components: Changelog Parameters
    • Environment:

      java 8
      gradle 5.2

    • Sprint:

      Description

      I have a jar file that contains my changelogs.
      This jar is a dependency of a project that executes all the changelogs contained.
      This si my jar layout

      I also included my main changeLog File.
      Liquibase can't resolve relative path inside the jar, I find out that the problem (and the solution) is here:

      AbstractResourceAccessor.convertToPath(final String relativeTo, final String path) {
      ...
      return convertToPath(new File(relativeTo).getParent() + '/' + path);
      ...
      }
      

      You can't do new File(relativeTo).getParent() inside a jar
      My solution is to change the code to this:

      return FilenameUtils.concat(FilenameUtils.getFullPath(relativeTo), path)
      

      EDIT:
      I'm totally wrong, my case is a corner case, new File(relativeTo).getParent() return null because relativeTo is "db.changelog-master.json" without a parent folder....

        Attachments

          Activity

            People

            • Reporter:
              andrea.vencato Andrea Vencato
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: