Home » Java » EnableMongoRepositories in multiple Spring configurations. Possible?

EnableMongoRepositories in multiple Spring configurations. Possible?

Posted by: admin October 26, 2017 Leave a comment

Questions:

Is it possible to use the @EnableMongoRepositories annotation in multiple configurations. Assuming that all of them have the same values.

I have a module with multiple Spring configurations that all need repositories from a package and I’m wondering if Spring is smart enough to run it only once in a context where all of the configurations are imported.

Answers: