I’m trying to use Liquibase with the liquibase-maven-plugin in a Spring Boot app and as a dependency I require the liquibase-hibernate6 jar, which helps with writing the differences between the database schema and the local project annotations. The version 6 of the dependency is suited for Hibernate 6.x.x version. However, when I attempt to do mvn dependency, nothing gets downloaded and in the same time I see the dependency’s groupID and version in red, resulting the error Dependency 'org.liquibase.ext:liquibase-hibernate6:4.18.0' not found. This is the current plugin configuration:
If we take a look at the central repository on https://repo.maven.apache.org/maven2/org/liquibase/ext/liquibase-hibernate6/4.18.0/, we can see that the liquibase-hibernate6 dependency with version 4.18.0 is accessible.
Why such behaviour occurs?
>Solution :
The behavior you are seeing where the dependency is not being downloaded and the groupID and version are displayed in red indicates that Maven is unable to locate the dependency in any of the configured repositories.
One possibility could be that Maven is unable to access the central repository due to network issues or connectivity problems. You can check whether Maven is able to connect to the central repository by running the following command in the terminal:
mvn help:effective-settings
This will display the effective Maven settings, which will include the configured repositories. Check whether the central repository is listed and whether there are any errors or warnings indicating that Maven is unable to access it.
If the central repository is not listed or if there are errors indicating that Maven is unable to access it, you can try adding the following configuration to your pom.xml file:
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
This explicitly configures Maven to use the central repository. Alternatively, you can try adding other repositories where the dependency might be located, such as the Spring repository:
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/release</url>
</repository>
</repositories>
If the issue persists, it could be that there is a problem with the dependency itself, or that there is a configuration issue with your project. In this case, you can try searching for the dependency in other repositories, or reaching out to the maintainers of the dependency for further assistance.
Goodluck
