I am trying to build a springboot project I built with Spring Tools Suite. I get the following error when I execute $mvn spring-boot:run
Downlo
If you don't want to use
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>(...)</version>
</parent>
as a parent POM, you may use the
mvn org.springframework.boot:spring-boot-maven-plugin:run
command instead.
Typos are a possible reason for this error.
Be sure to check you wrote spring-boot
and not e.g. springboot
or sprint-boot
or springbok
or whatever.
Also check the ordering : use spring-boot:run
and not run:spring-boot
.
You should run the $ mvn spring-boot:run
from the folder where your pom.xml
file is located and refer to this answer https://stackoverflow.com/a/33602837/4918021
In my case, my maven variable environment was M2_HOME, so I've changed to MAVEN_HOME and worked.
If you are using Spring Boot for application, forgetting to add
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.7.RELEASE</version>
</parent>
can cause this issue, as well as missing these lines
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
If you are running the
mvn spring-boot:run
from the command line, make sure you are in the directory that contains the pom.xml file. Otherwise, you will run into the No plugin found for prefix 'spring-boot' in the current project and in the plugin groups error.