question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to initialize main class liquibase.integration.commandline.LiquibaseCommandLine

See original GitHub issue

Environment

Liquibase Version: 4.16.0, 4.17.0

Liquibase Integration & Version: gradle 7.5.1

Liquibase Extension(s) & Version: -

Database Vendor & Version: PostgreSQL 14

Operating System Type & Version: Arch Linux, Microsoft Windows 11

Infrastructure Type/Provider: -

Description

Executing diffChangelog, diff, history, … results in the following errors:

> Task :diffChangeLog FAILED
liquibase-plugin: Running the 'main' activity...
Error: Unable to initialize main class liquibase.integration.commandline.LiquibaseCommandLine
Caused by: java.lang.NoClassDefFoundError: picocli/CommandLine$IFactory

Unable to initialize main class liquibase.integration.commandline.LiquibaseCommandLine

Caused by: java.lang.NoClassDefFoundError: picocli/CommandLine$IFactory

Execution failed for task ':diffChangeLog'.
> Process 'command '/home/dt/.jdks/openjdk-17.0.1/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

Steps To Reproduce

Execute diffChangelog, diff, history, … using gradle in IntelliJ IDEA 2022.2.3.

Actual Behavior

No changelog file is generated, see output above.

Expected/Desired Behavior

A changelog file is generated successfully in 4.15.0.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
LettuceBaconcommented, Nov 3, 2022

I had same problem after running project that was frozen for a few weeks. For me the workaround was adding picocli as a Liquibase runtime dependency:

dependencies {
    ...
    liquibaseRuntime 'info.picocli:picocli:4.6.3'
    liquibaseRuntime 'org.liquibase:liquibase-core:4.17.1'
    ...
}

Thank you! It works for me too.

0reactions
FBurguercommented, Nov 11, 2022

@dtext Looks like adding picocli as a dependency can fix your issue, did you try that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while running from command line java -jar liquibase.jar
liquibaseextracteddirectory>>java -jar liquibase.jar. Error: Unable to initialize main class liquibase.integration.commandline.Main
Read more >
Cant run liquibase with command line - java - Stack Overflow
The problem is that Liquibase can't find the required classes ... LIQUIBASE_CMDLINE='liquibase.integration.commandline.Main ...
Read more >
[CORE-3408] Error: Unable to initialize main class liquibase ...
Error: Unable to initialize main class liquibase.integration.commandline.Main Caused by: java.lang.NoClassDefFoundError: ch/qos/logback/core/ ...
Read more >
Main (liquibase 4.18.0 API) - Javadoc.io
use liquibase.integration.commandline.LiquibaseCommandLine. public class Main extends Object. Class for executing Liquibase via the command line.
Read more >
Working with Command Parameters | Liquibase Docs
This page explains how to run liquibase from the command line. You can also get specific information about the liquibase.properties files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found