Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make VS Code recognize nested gradle projects?

I cloned below git repo:

github.com/PacktPublishing/Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

I have installed latest Java and Spring extensions pack. When I open a new folder pointing to one of the folder for example Chapter09, it correctly recognizes 3 nested projects: api, util, eureka-server, but fails to recognize several nested projects under nested microservices folder. At the root level there is settings.gradle that defines all the nested gradle projects. Here is the screenshot:

screenshot

In eclipse it works fine but I need to use VS Code.

like image 409
ace Avatar asked Aug 24 '20 07:08

ace


People also ask

How do I sync gradle files with VS Code?

To sync gradle in VSCode. First open the terminal or cmd from the project folder. Then goto the android folder. Call the gradlew script.

How do I import a gradle project into VS Code?

Loading a Gradle project into VS code The first thing you should do is create the project's directory in which the build script will be edited. Then, launch VS Code. Now, the Gradle project's directory needs to be opened by VS Code. To do so, choose the Open Folder option from the File menu.


1 Answers

I saw these messages in the Problems view (e.g. project product-composite-service not being able to resolve its dependency on the api project):enter image description here

Try removing settings.gradle from folders

microservices\product-composite-service
microservices\product-service
microservices\recommendation-service
microservices\review-service

and then reimport the projects (via command Java: Import Java projects in workspace).

like image 195
mcernak Avatar answered Oct 14 '22 14:10

mcernak