Closed cgerard321 closed 3 years ago
Check if this works:
-you need the gradle wrapper in each module -delete the module -add the module again by using context menu "module setting" --> "+" --> "import module" --> navigate to the module folder
Hello Christine!
Sorry for a late response!
The chapters in the book follows the standard layout for Gradle multi-projects, so Intellij should be able to resolve the dependencies out of the box.
Can you repeat the following steps to verify that is works as expected? I'm using chapter 14 as an example since it is the chapter that contains most Spring Boot modules, i.e. have the highest complexity from a dependency perspective.
git clone https://github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud.git
cd Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud/Chapter14
./gradlew build
You should now be able to see all projects correctly detected and resolved by IntelliJ:
I'm using IntelliJ Ultimate 2020.3.2, but I don't think it matters, IntelliJ has always done a great job on resolving Java projects built with either Maven or Gradle!
Please, let me know if this works for you or if you run into any issues!
Regards, Magnus.
Hello,
This isn't so much an issue as perhaps a question about something that is not discussed in the book, namely, how do we create the project structure you have in your source code? For example, if I open Chapter05 in intellij and look at the project structure, it shows:
By the project structure I get looks like this (I've played around with it and sometimes get a slightly different structure such as one where all the projects are on the same level):
The result is that when gradle tries to sync in the IDE (Intellij Ultimate), I get the following error for every service:
A problem occurred evaluating root project 'product-service'.
Would it be possible to give some references as to how to correctly build the project structure? I'm not very familiar with Gradle or Modules in general.
Note: regardless of this, I am able to build and run via the command-line. It's just it would be very helpful to be able to get this to work in the IDE as it is preventing me from getting Swagger to work in Chapter 5 since the libraries aren't getting pulled in (due to Gradle not syncing).
Thank you! Christine