Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues with Spring Initializr project in IntelliJ

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?

like image 578
runnerpaul Avatar asked Sep 12 '25 08:09

runnerpaul


1 Answers

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
like image 152
Mr.Q Avatar answered Sep 13 '25 22:09

Mr.Q