codeconsole opened a new pull request, #16496: URL: https://github.com/apache/grails-core/pull/16496
## Problem `grails-data-mongodb-spring-boot` registered `MongoDbGormAutoConfiguration` in `META-INF/services/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`. Spring Boot reads `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`, so the auto-configuration was never applied: a Spring Boot application with the module on its classpath got no `MongoDatastore` and none of its GORM data services. The module's own example, `grails-test-examples/mongodb/springboot`, does not start: ``` Field bookService in example.BookController required a bean of type 'example.BookService' that could not be found. ``` Nothing caught it. The module's tests import the auto-configuration explicitly, and the example's test builds a `MongoDatastore` by hand instead of starting the application. Every other module in the repository puts the file under `META-INF/spring/`. Grails applications are not affected. They get GORM for MongoDB from the `mongodb` Grails plugin, and do not depend on this module. ## Change The file moves to `META-INF/spring/`. With it there, the example application starts and serves its books. ## Tests `MongoDbGormAutoConfigurationDiscoverySpec` checks that Spring Boot's `ImportCandidates` lists `MongoDbGormAutoConfiguration`, and starts a `@SpringBootApplication` that imports nothing against a MongoDB container, then saves and counts an entity through GORM. Both features fail with the file in its old place, the second with `No qualifying bean of type 'org.grails.datastore.mapping.mongo.MongoDatastore' available`. The module's tests and the `mongodb/springboot` example's test pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
