Why does mvn liquibase:diff need a changelog?

I notice the maven command “liquibase:diff” has a changelog. Why does it need one if it has a source DB and a target DB? How is the changelog used? The online docs and mvn liquibase:help don’t provide much detail.

mvn liquibase:diff -Dliquibase.changeLogFile=/db/changelog/changelog01.h2.sql -Dliquibase.diffTypes=“tables,views,columns,indexes,foreignkeys,primarykeys,uniqueconstraints,data” -Dliquibase.diffChangeLogFile=src/main/resources/db/changelog/mydiff.h2.sql -Dliquibase.url=jdbc:h2:~/qa -Dliquibase.username=admin -Dliquibase.password= -Dliquibase.referenceUrl=jdbc:h2:~/dev -Dliquibase.referenceUsername=admin -Dliquibase.referencePassword=

Hi @jchaplin ,

I got your question and I totally agree with you. Have you tried running diff without providing changeLogFile attribute to it? Does it result into any error?

Yes, I have tried running it without changelog. I get the below error.

Failed to execute goal org.liquibase:liquibase-maven-plugin:4.3.3:diff (default-cli) on project h2-dbs: The changeLogFile must be specified.

By the way I’m using version 4.3.2 of the liquibase-maven-plugin.