You’ve created a circular dependency, or you're importing a module (tms-admin) that should not expose JPA Repositories to other modules like tms-core.
Spring Boot multi-module architecture best practices discourage cross-module repository usage like this.
A good solution here could be Restructure Your Modules.
Move CustomerRepository and related entities (like Customer) into a new shared module, like TMS-data
then update your module dependencies like:
In core:
<dependency>
<groupId>com.TMS</groupId>
<artifactId>tms-data</artifactId>
<version>3.4.3</version>
</dependency>
in admin:
<dependency>
<groupId>com.TMS</groupId>
<artifactId>tms-data</artifactId>
<version>3.4.3</version>
</dependency>
Now both core and admin can use CustomerRepository without circular dependency.
Do not forget to enable JPA repository scanning in your main application (usually in core):
@SpringBootApplication(scanBasePackages = "com.TMS")
@EnableJpaRepositories(basePackages = "com.TMS.customer.repository")
@EntityScan(basePackages = "com.TMS.customer.model")
Using CustomerRepository directly from tms-admin inside tms-core creates tight coupling and breaks modularity.
It may work temporarily with tricks like manually adding @ComponentScan, but will always break Maven and clean builds due to dependency cycles.