今天在学习spring boot的时候,用maven启动项目时出现如下报错信息:
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 th e repositories [local (C:\Users\Administrator.m2\repository), alimaven (http://
maven.aliyun.com/nexus/content/groups/public/)] -> [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。
上网找了下答案,发现也有人遇到过,现把几种情况说明下:
1、pom.xml里少了parent,代码如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.7.RELEASE</version>
</parent>
这种错误几乎不会存在。
2、少了如下代码:
<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>
3.你运行mvn spring-boot:run
时的路径不对,帖子原文如下:
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.
大致意思就是:
在命令行运行 mvn spring-boot:run
时,一定要确保你是在包含了该pom.xml的路径下,不然就会出现 No plugin found for prefix 'spring-boot' in the current project and in the plugin groups
这种错误。
我就是这个原因,然后到了所含pom.xml的目录下运行mvn spring-boot:run
就顺利启动了。
参考文章:
http://blog.csdn.net/mr_ooo/article/details/54341184