Applies to
- Liquibase Secure (Pro)
- Liquibase Community (Open Source)
Conditions
Liquibase v4.32.0-4.33.0
JDBC driver JAR files included with Liquibase or added manually
Custom
--classpathusage or extra drivers placed inliquibase/lib
Issue Summary
When running Liquibase, you may see a warning about duplicate JAR files. This message can apply to any JDBC driver (for example: PostgreSQL, Oracle, MySQL), JAR file, or extension.
Error Message
WARNING: *** Duplicate <driver-name> JAR files ***
/liquibase/internal/lib/<driver>.jar
/liquibase/lib/<driver>.jar(Exact paths may vary depending on your setup.)
Root Cause
Liquibase added this warning to help identify when multiple versions of the same driver or JARs are being loaded, which can cause conflicts.
By default, Liquibase ships with a single version of each supported JDBC driver and/or JAR in the liquibase/internal/lib folder. Liquibase automatically loads files from the liquibase/internal/lib, liquibase/internal/extensions, and liquibase/lib directories.
This warning usually occurs for one of the following reasons:
Duplicate JAR files exist in the Liquibase install directory (i.e.,
liquibase/internal/lib,liquibase/internal/extensions, orliquibase/lib).Classpath is explicitly set to point to a driver JAR that Liquibase already loads by default. For example:
liquibase --classpath=/liquibase/lib/<driver>.jar
Driver JARs exist in both
liquibase/libandliquibase/internal/lib, causing Liquibase to load the same driver from two different locations.
Resolution
Verify which JAR files are installed:
Review the contents of
/liquibase/internal/lib,/liquibase/internal/extensions, and/liquibase/libto confirm that there is only one JAR file, as indicated by your error message.Run
liquibase --versionto confirm the expected JDBC driver version is being used.
Remove duplicates:
If you see multiple copies of the same JAR, keep only one copy (preferably the one that ships with Liquibase in
liquibase/internal/lib).
Update your Liquibase command:
If you are explicitly setting
--classpathto point to a driver that Liquibase already includes, remove that option to avoid loading it twice.
Once resolved, Liquibase should only load a single JDBC driver, and the warning will no longer appear.
Comments
0 comments
Article is closed for comments.