No plugin found for prefix 'spring-boot' ...的问题解决方法

今天在学习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

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值