PacktPublishing / Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

Hands-On Microservices with Spring Boot and Spring Cloud, published by Packt
MIT License
464 stars 406 forks source link

Multi-Module Spring Boot Application with Gradle not work IntelliJ #14

Closed jhovannycanas closed 3 years ago

jhovannycanas commented 3 years ago

cordial greetings when I try to use the api library in the product-service microservice using IntelliJ, it says that the project is not found, I followed the instructions in the book but the project is not found.

Caused by: org.gradle.api.UnknownProjectException: Project with path ':api' could not be found in root project 'product-service'.

this is the settigs.gradle

include ':microservices:product-service' include ':microservices:review-service' include ':microservices:recommendation-service' include ':microservices:product-composite-service' include ':api' include ':util'

this is the dependency call in product-service

dependencies { compile project(':api') implementation project(':util') implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.springframework.boot:spring-boot-starter-webflux' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'io.projectreactor:reactor-test' }

Miles-Ahead-Digital commented 3 years ago

This works:

dependencies { implementation project(':api') implementation project(':util') implementation('org.springframework.boot:spring-boot-starter-actuator') implementation('org.springframework.boot:spring-boot-starter-webflux') ....

magnus-larsson commented 3 years ago

Hello and thanks for the question!

I guess that IntelliJ has not been able to resolve the dependencies between the product-service microservice. Can you follow the instructions in my reply in issue #13 to ensure that you instruct IntelliJ to setup dependencies correctly?

Please, let me know if this works or if you run into any problems!

masoud-moghini commented 3 years ago

same problem with eclipse ,also applied @Miles-Ahead-Digital solution ,which is original code in Chapter3 forlder, didn't solve the issue > Project with path ':api' could not be found in root project 'product-services'.

jhovannycanas commented 3 years ago

tks, Magnus