我有一个问题,正确配置mongock为我的项目。
我添加了pom.xml依赖项:
<dependencies>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-springboot</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongodb-springdata-v3-driver</artifactId>
<version>5.2.2</version>
</dependency>
...
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongock-driver-mongodb-bom</artifactId>
<version>5.2.2</version>
<type>pom</type>
</dependency>
...
</dependencies>
</dependencyManagement>
我在ApplicationClass上添加了注解:@使能蒙哥克
在application.yml中,我添加了配置:
mongock:
migration-scan-package:
- com.test.project.config.dbmigrations
enabled: true
文档中说这个设置应该足够了,但是当我运行应用程序时,我得到了错误:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method getBuilder in io.mongock.runner.springboot.config.MongockContext required a bean of type 'io.mongock.driver.api.driver.ConnectionDriver' that could not be found.
Action:
Consider defining a bean of type 'io.mongock.driver.api.driver.ConnectionDriver' in your configuration.
你知道怎么修吗?先谢了。
1条答案
按热度按时间nfeuvbwi1#
您可以尝试创建一个设置bean。