I am working on a Spring boot application from IntelliJ and the pom.xml contains the liquibase plugin like this:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>4.30.0</version>
<configuration>
<changeLogFile>src/main/resources/db/changelog/changelog-master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/db/migrations/${timestamp}_changelog.xml</diffChangeLogFile>
<url>jdbc:postgresql://177.45.56.76:5432/mydb</url>
<driver>org.postgresql.Driver</driver>
<username>user</username>
<password>password</password>
<referenceUrl>hibernate:spring:com.bostek.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.30.0</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate6</artifactId>
<version>4.30.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>
As you can see I compare the model with the database.
The problem is that each time I run the command “mvn liquibase:diff”, liquibase plugin does not return the changes between the model and the database, but anything else that already exists in the databasechangelog table.
What am I doing wrong?
Liquibase is supposed to be an easy tool that does the job, but it has taken me a lot of time to find a solution.
Could you please help me?