Liquibase maven rollback command: [ERROR] Unknown lifecycle phase ".rollbackCount=1"

215 views Asked by At

I'm using Spring-Boot v3.1.3 with Liquibase v4.23.1.

The command for creating diff and update for Liquibase work correctly as expected:

- mvn liquibase:diff 
- mvn liquibase:update 

But when I want to rollback the applied changelog (migration) with the command:

- mvn liquibase:rollback -Dliquibase.rollbackCount=1

I've got the error:

[ERROR] Unknown lifecycle phase ".rollbackCount=1". You must specify a valid lifecycle phase or a goal in the ...

What is the problem and how can I fix it?

2

There are 2 answers

0
Mehdi Rahimi On

I found the answer in the forum of Liquibase site [link]

It's a little wired but in Windows OS,

I tried with CMD instead of PowerShell (or IntelliJ embedded Terminal) and the problem was solved!

0
Brandenfascher On

It appears to work correctly for me by adding quotation marks around the added parameter like so:

mvn liquibase:rollback "-Dliquibase.rollbackCount=1"