-1

I have maven spring boot project generated in spring initializer. Every time when I switch to this project in IntelliJ Idea project doesn't open correct. It means every java classes have red J icon until I click with right mouse button on project and go into Run Maven > Reimport

enter image description here

When I switch to another projects which are maven spring boot projects as well, projects are open correctly. I have problem only with this one. Do you have idea how to fix it without reimport every time when I open project?

Thank you.

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
  • Can you provide us with the code? Impossible to say with this info. The green color means "new element" in the VCS. See this for more info: https://stackoverflow.com/a/45154141/5640649 – lealceldeiro Oct 12 '18 at 15:20
  • @lealceldeiro I know that color is related with git. I have no problem with that. Problem is with that red icons of source files – Denis Stephanov Oct 12 '18 at 15:26
  • @DenisStephanov please see https://stackoverflow.com/a/43319356/104891. See what errors are logged when the project is imported. If there is `.idea` directory, delete it and reimport. – CrazyCoder Oct 12 '18 at 19:26
  • @CrazyCoder I tried remove .idea folder :/ also I check problems in project configuration and there isn't anyone. I just created new spring project and switch to another which already works. Then I switch back and project isn't imported well and I have to do manually. – Denis Stephanov Oct 12 '18 at 22:09
  • @DenisStephanov any errors in [idea.log](https://intellij-support.jetbrains.com/hc/articles/207241085)? Can you share the [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)? – CrazyCoder Oct 12 '18 at 22:11

1 Answers1

0

you have to Enable Auto import Maven.. In the right bottom corner of IntelliJ , there is a Event Log tab. when you click it It might be show you the option Enable Auto Import. Or manually you have to enable Auto import by go to the settings. Then every time IntelliJ automatically import the Project as Maven.

Khalid Shah
  • 3,132
  • 3
  • 20
  • 39