New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ant integration seems to be broken #2388
Comments
Did some digging. I'm not a maven-shade expert, but apparently maven shade was introduced with this commit. This seems to be the change that causes the issue by relocating "org.apache" to "liquibase.repackaged.org.apache" on a bytecode level:
I suspect that this will also rewrite the byte code for the ant integration located under "liquibase.integration.ant", thus leading to the attempt to load classes from "liquibase.repackaged.org.apache.tools.ant" instead of "org.apache.tools.ant". A simple include or exclude in the relocation configuration should solve the issue. |
Thanks @mirkobeine for the digging! We will take a look. |
Thanks @mirkobeine, there is a few issues that are being impacted by that too. The shading is apparently not as smart as we were expecting... I can take care of the PR and coordinate it with the other related issues. |
The Ant task Successful ant databaseUpdate Output by Fix Build
Error Before Fix
NOTE If you do not have snakeyaml.jar in your Ant classpath, you will see errors loading the following services: liquibase.license.LicenseService, liquibase.parser.ChangeLogParser and liquibase.hub.HubService. You can ignore these errors if you do not need any those services; in particular the Liquibase Ant Integration does not support Liquibase Hub. The errors are mitigated by dropping the snakeyaml.jar into your liquibase/lib directory in the Ant project. Test Environment |
Environment
Liquibase Version: 4.6.2, 4.7.0
Liquibase Integration & Version: ant 1.10.12
Liquibase Extension(s) & Version:
Database Vendor & Version: MariaDB 10.3
Operating System Type & Version: Windows 10, JDK 16
Description
We're in the process of upgrading an existing project. Part of the upgrade is to upgrade liquibase from version 3.5.3 to >= 4.6.2.
We use an ant build file to setup / tear down our local development database, which includes applying our liquibase migrations.
To do so, we use the ant integration tasks provided by liquibase, e.g.
<liquibase:updateDatabase />
.Everything works fine with liquibase 3.5.3 when executing the build file tasks from our IDE or from a console.
However, when trying to execute the same ant tasks with liquibase 4.6.2 oder 4.7.0, the execution fails with a ClassNotFoundException for
liquibase/repackaged/org/apache/tools/ant/Task
.We haven't tried other versions of liquibase. Changing everything back to liquibase 3.5.3 immediately resolves the problem.
Steps To Reproduce
Actual Behavior
Sample build file:
Stack trace:
Expected/Desired Behavior
The integration works.
Additional Context
The text was updated successfully, but these errors were encountered: