Liquibase diff not showing a domain class change in the changelog

Hello everybody,
Could you please help me with the following issue because I have tried many things but none has worked.

I have added a new column in one of the domain classes as shown below:

@Column(name = "my_item")
private String myItem;

But the command mvn liquibase:diff is not returning this change in the changelog.

I have captured the log of the diff operation. It shows that the new column has been detected and there is no error during execution.

[INFO] Found column my_item varchar(255)

Below is the liquibase-maven-plugin configuration in the pom.xml

<plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>4.29.0</version>
                <configuration>
                    <changeLogFile>src/main/resources/db/changelog/db.changelog-master.yaml</changeLogFile>
                    <outputChangeLogFile>db-changelog.xml</outputChangeLogFile>
                    <diffChangeLogFile>src/main/resources/db/migrations/${timestamp}_changelog.xml</diffChangeLogFile>
                    <url>jdbc:postgresql://172.54.98.77:5432/nn</url>
                    <driver>org.postgresql.Driver</driver>
                    <username>nnuser</username>
                    <password>123456</password>
                    <referenceUrl>hibernate:spring:com.nn.domain?dialect=org.hibernate.dialect.PostgreSQLDialect</referenceUrl>
                    <verbose>true</verbose>
                    <logging>debug</logging>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.liquibase</groupId>
                        <artifactId>liquibase-core</artifactId>
                        <version>4.29.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.liquibase.ext</groupId>
                        <artifactId>liquibase-hibernate6</artifactId>
                        <version>4.28.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-data-jpa</artifactId>
                        <version>3.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-validation</artifactId>
                        <version>3.4.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hibernate.orm</groupId>
                        <artifactId>hibernate-core</artifactId>
                        <version>6.6.2.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-entitymanager</artifactId>
                        <version>6.0.0.Alpha7</version>
                    </dependency>
                </dependencies>
            </plugin>

Hi @stratosb,

I couldn’t tell from your question where you were expecting the changeset to show up. From your configuration it looks like it should show up in src/main/resources/db/migrations/${timestamp}_changelog.xml. Is that file missing or empty? Does it contain other changes?

Hi there,
It creates the changelog but it doesn’t contain the “add column” as it should. It seems that the diff command cannot detect the new column which has been added in the domain class.
The log output is the following:

[INFO] Creating snapshot
[INFO] Diff command completed
[INFO] changeSets count: 0
[INFO] No changesets to add to the changelog output.
[INFO] Diff changelog command succeeded
[INFO] Command execution complete