Hi Ivy Team,
I've been trying to update Liquibase dependency to 4.24.0 recently into a project running on the Axon Ivy 12.0.6 and ran into an issue I thought was worth sharing (and possibly improving).
The Issue:
Liquibase uses Java's ServiceLoader mechanism to discover implementations of liquibase.logging.Logger at runtime. This usually works fine in a flat classpath setup (e.g., a standalone Java app or simple Maven project). However, in the environment that Axon Ivy uses, the ServiceLoader is not able to find the default Logger. This results in a runtime error like:
liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
Since Liquibase's logger is packaged in a different jar, the ServiceLoader in the Ivy runtime (ch.ivyteam.ivy.java.internal.IvyProjectClassLoader) cannot see the service definition. Even if project's custom logger to be placed in the recommended location (/META-INF/services/liquibase.logging.Logger ). Sometimes on debug the custom logger succeeds to be loaded but all other services exposed by liquibase are not available to the ServiceLoader.
I tried placing liquibase jar into webapps/ivy/WEB-INF/lib folder of the designer/engine as proposed in this discussion but this resulted in running of incorrect class loader.
I'd love to hear how others have handled this — or if there’s an approach more in line with how Ivy is designed to work in such cases.
Thanks a lot for any insights or suggestions!
Regards, Milena