I run "mvn liquibase:diff" and already configure the diffChangeLogFile, but the diffChangeLogFile file just have the head information.(like below)
diff.changelog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"/>
But I run the liquibase diff in the command line way with same configuration, there are correct information in the diffChangeLogFile file.
My pom.xml as below:
<execution>
<id>diff</id>
<configuration>
<changeLogFile>src/main/resources/db/insert_person6.xml</changeLogFile>
<driver>org.postgresql.Driver</driver>
<url>${liquabase.url}</url>
<username>${liquabase.username}</username>
<password>${liquabase.urpasswordl}</password>
<referenceUrl>${liquabase.referenceUrl}</referenceUrl>
<referenceUsername>${liquabase.referenceUsername}</referenceUsername>
<referencePassword>${liquabase.referencePassword}</referencePassword>
<diffChangeLogFile>${liquabase.diffChangeLogFile}</diffChangeLogFile>
</configuration>
<goals>
<goal>diff</goal>
</goals>
</execution>
Is there anyone met the same problem?
That should work, and given that the diffChangeLogFile is written to, the parameter must be being set correctly.
An empty file like you are seeing is usually caused by comparing two databases that are equal. Perhaps your liquibase.url and liquibase.refereneceUrl are not set correctly.
If you run liquibase:diff without the diffChangelogFile parameter it should create a diff report that includes connection information. See if that matches up with what you expect.