2

Setup:

  • Intellij IDEA community edition 2020.2
  • Spring Bott starter parent: 2.3.5
  • Java 11
  • WRAPPER_VERSION: 0.5.6
  • mvn 2

Hi, I googled a lot e.g. here but I just can't fix it. I created a new mvn spring project with Intellij. When I commit the project I get errors detected by code analyses in class: MavenWrapperDownloader.java. e.g. It reports:

Cannot resolve symbol String

I tried:

  1. invalidate caches and restart
  2. delete .idea folder and reimport
  3. checked sdk setup
  4. mvn reimport
  5. mvn clean and then rebuild (while the build is always successful)

I'm pretty new to maven. I guess the scope of the mvn package might be wrong because the build process works as expected.

UPDATE: I reinstallt my openjdk11. No success. Then I found out that my .mvn/wrapper dir is not set as source root. I know that was never the case in my other projects. As a trial I've set my .mvn folder as source root and now the MavenWrapperDownloader.java file is recognized as a java class and the compiler interprets the symbols. But now there is another error. It says I have to define a package name for that class because the class does not have one per default. It is pretty strange to me. I also tried to use another spring boot starter version but nothing changed

When I execute Analyze->inspect code I get the following:

enter image description here

FishingIsLife
  • 1,972
  • 3
  • 28
  • 51

2 Answers2

0

I had the same problem and File -> Invalidate Caches/Restart fixed it - at least for now.

IntelliJ Ultimate 2020.3 Spring Boot Starter Parent 2.4.2 Java 15 Maven 4.0.0 Maven Wrapper 0.5.6

Dennis
  • 33
  • 6
  • 1
    that's not an answer to the question. As you can see, I've mentioned that I tried this solution. In addtion I reported the error for community edition and not Ultimate. No down vote because it might help others with this setup. – FishingIsLife Jan 28 '21 at 06:41
  • Sorry, still new here. I just posted it in case it might help others. I would have done it by comment, but my account is not old enough to comment other answers than my own. – Dennis Jan 28 '21 at 14:19
  • No problem. Welcome on board – FishingIsLife Jan 28 '21 at 14:21
  • Having the same issue with roughly similar configuration (Intellij CE), Invalidate Caches/Restart didn't make it, but marking the 'wrapper' folder as excluded lifted the blocking error on code analysis/commit. However, consequences are yet unclear to me. – Vincent AUDIBERT Apr 10 '21 at 08:49
0

The easiest solution is to generate your project again with Spring Starter.

After you set up everything you need at pom file -> Generate -> Download it.

Open with your IDE and copy-paste all code sources which you have already written.

catch23
  • 17,519
  • 42
  • 144
  • 217