Maven- No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

匿名 (未验证) 提交于 2019-12-03 01:57:01

问题:

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

    org.springframework.bootspring-boot-maven-plugin--spring.profiles.active=dev

I tried the jhipster plugin above and no change in the error.

回答1:

If you are using Spring Boot for application, forgetting to add

org.springframework.bootspring-boot-starter-parent1.2.7.RELEASE

can cause this issue, as well as missing these lines

spring-releaseshttps://repo.spring.io/libs-releasespring-releaseshttps://repo.spring.io/libs-release


回答2:

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.



回答3:

You might want to add the following to your pom and try compiling

   spring-snapshotshttp://repo.spring.io/libs-snapshottruespring-snapshotshttp://repo.spring.io/libs-snapshottrue


回答4:

Adding spring-boot-maven-plugin in the build resolved it in my case

mysample-weborg.springframework.bootspring-boot-maven-pluginorg.springframeworkspringloaded1.2.1.RELEASE


回答5:

In my case, my maven variable environment was M2_HOME, so ive changed to MAVEN_HOME and worked.

Tnx.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!