3

I created a project using Spring Initializr.

When I open it in IntelliJ I see this error in the build:

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 ()' not found at org.jetbrains.idea.maven.server.embedder.CustomModelValidator.(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

I also noticed if I try to add a run configuration no main class is found. What could be wrong here?

runnerpaul
  • 5,942
  • 8
  • 49
  • 118

1 Answers1

4

Tried

./mvnw spring-boot:run

and it worked fine but running it in IDE fails. IntelliJ by default uses the Maven wrapper to load the project.

Therefore there are two temporary solutions:

  • Navigate to settings > build tools > maven and use a different maven home path (use a locally installed maven or bundled version) enter image description here
  • Delete the mvnw file so it will force Idea to use locally installed maven
Mr.Q
  • 4,316
  • 3
  • 43
  • 40