Reputation: 1402
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
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 14.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 21.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.032 s
[INFO] Finished at: 2015-06-15T17:46:50-04:00
[INFO] Final Memory: 11M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/admin/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException`
Heres my pom.xml plugin
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<arguments>
<argument>--spring.profiles.active=dev</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
I tried the jhipster plugin above and no change in the error.
Upvotes: 140
Views: 247353
Reputation: 1051
If you don't want to use
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>(...)</version>
</parent>
as the parent POM, you may use
mvn org.springframework.boot:spring-boot-maven-plugin:run
instead.
Upvotes: 73
Reputation: 377
In my case I got this error after updating my spring boot in pom.xml and running it in Eclipse.
The source of the error is that the run configuration was set to offline, thus it couldn't download plugins on run.
Upvotes: 1
Reputation: 11
In my case, my maven variable environment was M2_HOME, so I've changed to MAVEN_HOME and worked.
Upvotes: 0
Reputation: 1047
Instead of using the full plugin name (with groupId) like described in Bartosz's answer, you could add
<pluginGroups>
<pluginGroup>org.springframework.boot</pluginGroup>
</pluginGroups>
to your .m2/settings.xml.
Upvotes: 2
Reputation: 465
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
.
Upvotes: 30
Reputation: 981
Use mvn spring-boot:run
.
No mvn sprint-boot:run
Error Writing.
Upvotes: 10
Reputation: 29
Make sure pom.xml exist in the directory, when using the mvn spring-boot:run command. No need to add any thing in the pom.xml file.
Upvotes: 3
Reputation: 369
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
Upvotes: 9
Reputation: 17860
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.
Upvotes: 276
Reputation: 8771
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>
Upvotes: 50
Reputation: 1259
Adding spring-boot-maven-plugin in the build resolved it in my case
<build>
<finalName>mysample-web</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.1.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Upvotes: 6
Reputation: 781
You might want to add the following to your pom and try compiling
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Upvotes: 14