Build a patched version of Liquibase 4.8.0

We are running into some issues attempting to patch liquibase 4.8.0 and publish it to our local artifactory instance. The steps we used to build and publish the patched version are:

  1. Updated the version in the following pom.xml files from “0-SNAPSHOT” to “4.8.0-XYZ.0.0.1”

liquibase-cdi/pom.xml
liquibase-cli/pom.xml
liquibase-core/pom.xml
liquibase-dist/pom.xml
liquibase-extension-examples/pom.xml
liquibase-extension-testing/pom.xml
liquibase-integration-tests/pom.xml
liquibase-maven-plugin/pom.xml

  1. Updated file source in liquibase-dist/src/main/assembly/assembly-bin.xml from <source>${project.build.directory}/liquibase-0-SNAPSHOT.jar</source> to <source>${project.build.directory}/liquibase-4.8.0-XYZ.0.0.1.jar</source>

  2. Updated the configuration section for the maven-deploy-plugin in pom.xml from skip=true to skip=false.

  3. Remove the execution section below for the maven-deploy-plugin in pom.xml to enable the deploy task

         <plugin>
             <artifactId>maven-deploy-plugin</artifactId>
             <version>2.8.2</version>
             <configuration>
                 <skip>false</skip>
             </configuration>
             <executions>
                 <execution>
                     <id>default-deploy</id>
                     <phase>none</phase>
                 </execution>
             </executions>
         </plugin>
    
  4. Add the required distributionManagement section.

  5. ./mvnw --debug --settings ${WORKSPACE}/settings.xml clean package deploy

Using these steps we see the patched version of the liquibase artifacts are published to our artifactory instance. However, when we attempt to add a dependency on the patched version of the liquibase-core to our project we see the following error.

Could not resolve all dependencies for configuration ‘:dependency’.
Could not resolve org.liquibase:liquibase-core:4.8.0-XYZ.0.0.1.
Required by:
project :
Could not resolve org.liquibase:liquibase-core:4.8.0-XYZ.0.0.1.
inconsistent module metadata found. Descriptor: org.liquibase:liquibase-dist:4.8.0-XYZ.0.0.1 Errors: bad module name: expected=‘liquibase-core’ found=‘liquibase-dist’

Any help resolving this issue would be greatly appreciated. Also if the steps we are using to build and release a patched version of liquibase are not correct, could you provide the correct steps?

I would have thought that just replacing any 0-SNAPSHOT strings with the version you want would work. The “liquibase-dist” module name error, though, is pointing something around how it’s being built being a bit off.

We have the liquibase-core and liquibase-dist submodules. In reality, “liquibase-dist” is what gets distributed via maven as “liquibase-core”. It’s like that for historical/refactoring reasons and and we’re planning on sorting that out soon, but for now it’s a bit confusing. In 4.8.0, the liquibase-dist/target jar is called liquibase.jar but that jar is the one you want to distribute in artifactory as “liquibase-core”.

That jar should have that as the artifactId in the embedded pom file, so if it’s complaining about liquibase-dist I’m wondering if you’re deployign with the wrong pom? The one in the jar is probably the best bet for you to use.

Nathan

1 Like