Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

when Using start.spring.io projects generated with springboot 2.7 comes with MavenProject 3.8.5 which when imported in intellij causes an error that is quite difficult to debug or not self speaking by itself.

The error

java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoSuchMethodError: org.apache.maven.model.validation.DefaultModelValidator: method 'void <init>()' not found
  at org.jetbrains.idea.maven.server.embedder.CustomModelValidator.<init>(Unknown Source)
  while locating org.jetbrains.idea.maven.server.embedder.CustomModelValidator
  at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
  while locating org.apache.maven.model.validation.ModelValidator annotated with @com.google.inject.name.Named(value="ide")
1 error
      role: org.apache.maven.model.validation.ModelValidator
  roleHint: ide
                What the version of IntelliJ IDEA? That should have been fixed in 2022.1 in the scope of this bug
– Konstantin Annikov
                Jun 20, 2022 at 9:02
                Please show the pom file for that project..also more log output of that error ... Check to build on plain command line... not inside of IDEA..
– khmarbaise
                Jun 20, 2022 at 9:16

Under Intellij File > Setting > Build Execution... > Build tools > Maven > Maven home path just point to your maven directory:

Apply and reload project.

this is the only solution that worked for me - thank you! I tried a dozen of other tricks like Maven - Reload, and rebuild, etc - not nothing worked. – Marina Mar 17 at 15:48 I can confirm that changing Maven to version (in my case) 3.8.1 works with Spring Boot 2.7 as well. – Radek Jul 25, 2022 at 11:32

I've just ran into this problem 20mins ago with my friend's project. The solution is just perfect. If you don't want to update your IDE (for any reason) or downgrade yor Maven version, you just need to change your Maven Home path: (File | Settings | Build,...etc. | Build Tools | Maven) for any listed variant except "...wrapper". Generally, I use separated maven in C:/my-maven-folder/...wrapper, so I've never had such a problem. Hope it helps!

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.