I'm working on a multi project build using Spring Boot 2.1.5.RELEASE.
I shared an example at https://github.com/MBurchard/ACME
When running the test cases from the storage sub project, all YAML configurations from inside the storage project are found and used.
When running SpringBootApplication from web project with profile dev it shows an error.
spring:
# PROFILES
profiles:
active: ${profile:dev}
Error cause
Caused by: java.lang.IllegalArgumentException: Not a managed type: class de.mbur.acme.User
at org.hibernate.metamodel.internal.MetamodelImpl.managedType(MetamodelImpl.java:552) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:74) ~[spring-data-jpa-2.1.8.RELEASE.jar:2.1.8.RELEASE]
at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:66) ~[spring-data-jpa-2.1.8.RELEASE.jar:2.1.8.RELEASE]
The reason is clear. it does not use the application.yml from the storage project.
When switching to dev-full-config everythink works fine
spring:
# PROFILES
profiles:
active: ${profile:dev-full-config}
But I don't want to repeat the full configuraton for the database that is more or less internal.
What can I do to get this work without repeating the internal database configuration?