I spent my day trying to understand but I can't understand my problem.
I have 1 spring module (https://spring.io/guides/gs/multi-module/) [I also have JPA in the sub module] and 2 microservices (A and B).
In microservice A, I arrive at @Autowired CountryRepository (which extends from JpaRepository) and which works very well, SpringBootApplication (scanBasePackages = "**") with, I access my data and I can compile.
On microservice B, I did the same thing, I manage to access my data but impossible to compile:
****************************
FAILED TO START APPLICATION
****************************
Description:
Field countryRepository in * required a bean named 'entityManagerFactory' that could not be found.
The injection point has the following annotations:
- @ org.springframework.beans.factory.annotation.Autowired (required = true)
Action:
Consider defining a bean named 'entityManagerFactory' in your configuration.
I cannot understand or look for the error, how to unblock myself, I search again and again but I cannot understand why microservice B does not want to compile.
I use a POM Parent, and I was careful to put the following order:
<modules>
<module>sub module </module>
<module> microservice A </module>
<module> microservice B </module>
</modules>
So I hack, without understanding too much and sometimes I have different messages but always the compilation which fails
Concretely, it is possible to use the Repositories of the sub-module in microservice A and B?
Thank you for your attention and your help