1

Adding my project to a new machine and having some struggles importing it in IntelliJ.

Using Java, Spring Boot, Gradle, Maven, latest stable IntelliJ.

My issues are that:

1) The thing is set up with "main1, main2, main3, main4" which I don't think is the correct way for IntelliJ to read the project structure

2) The imports aren't working

import org.springframework.boot.SpringApplication;

returns:

Cannot resolve symbol SpringApplication

How do I remove the project and import it again correctly?

I see this similar answer, but need a little more handholding:

Cannot resolve symbol SpringApplication

Where do I find these directories to delete them? When I import, do I need to run gradlew clean build or mvn import to make sure my dependencies are being imported? It seems to be trying (and failing) to compile the js client files when I run these, which I don't think is correct.

8t12c7081
  • 683
  • 3
  • 9
  • 30
  • Directory ` .idea/libraries internals` is created in the same directory where your project resides. – Ivan Nov 05 '18 at 19:29
  • From looking into the answer I linked - Deleted .idea/libraries, .m2/repository has nothing in it, restarted intellij and do not see where to import pom.xml, I think it does not exist. I am probably missing a step when importing the project – 8t12c7081 Nov 05 '18 at 19:55
  • You need to use `Open file or Project` in Intellij and choose pom.xml as a file to open. – Ivan Nov 05 '18 at 19:57
  • I think I see where the confusion is. I'm using build.gradle instead of pom.xml. But I still don't see where the build file is supposed to be selected when importing the project. – 8t12c7081 Nov 05 '18 at 21:23
  • Resolved - the build.gradle needs to be specified in the first prompt where it asks you to choose a project to import. I was importing the project root directory. – 8t12c7081 Nov 05 '18 at 21:45

1 Answers1

0

Answer linked in original question should help people with this problem - however, here are the steps I took to resolve:

-delete entire project and clone it down from git again

-import to IntelliJ and specify the build.gradle file (pom.xml if you aren't using gradle), not the root project folder

-run gradlew clean build

-follow chain of prompts for other broken things like lombok, mysql, aws cli

8t12c7081
  • 683
  • 3
  • 9
  • 30