2017-05-08 138 views
0

在這個問題上花了很多時間。無法找到並自行解決此問題的方法。我嘗試刪除我的本地回購協議並重新安裝,在我的POM等中添加插件庫......令我驚訝的是,我有另一個項目使用相同的spring-boot-maven-plugin 1.2.3,並且該項目不會出錯但運行良好。mvn spring-boot:運行失敗

運行mvn spring-boot:run錯誤出No plugin found for prefix 'spring-boot' in the current project and in the plugin groups

與MVN -e選項運行顯示以下

org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: 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/auhuman/.m2/repository) 

一個例外,但我的本地庫下面有這個插件。

ls ~/.m2/repository/org/springframework/boot/spring-boot-maven-plugin/1.2.3.RELEASE/ 

_remote.repositories     spring-boot-maven-plugin-1.2.3.RELEASE.jar.sha1  spring-boot-maven-plugin-1.2.3.RELEASE.pom.sha1 
spring-boot-maven-plugin-1.2.3.RELEASE.jar  spring-boot-maven-plugin-1.2.3.RELEASE.pom 
spring-boot-maven-plugin-1.2.3.RELEASE.jar.lastUpdated spring-boot-maven-plugin-1.2.3.RELEASE.pom.lastUpdated 

我的pom.xml有

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.3.RELEASE</version> 
    <relativePath/> 
</parent> 

<build> 
     <plugins> 
      <!-- Spring Boot Maven --> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
     </plugins> 
</build> 

回答

0

您可以檢查是否存在/Users/auhuman/.m2/repository/org/springframework/boot一個spring-boot文件夾?

如果沒有嘗試運行mvn clean install

+0

是的。它在那裏。 LS〜/ .m2目錄/庫/組織/ springframework的/引導/ 彈簧引導\t \t \t彈簧引導起動高速緩存 彈簧引導促動器\t \t彈簧引導起動數據JPA 彈簧boot-自動配置\t彈簧引導啓動-JDBC 彈簧引導依賴\t彈簧引導啓動日誌記錄 彈簧引導裝載工具\t彈簧引導啓動父 彈簧引導Maven的插件\t彈簧boot-starter-test spring-boot-parent \t \t spring-boot-starter-tomcat spring-boot-starter \t \t spring-boot-starter-web spring-boot-starter-actuator \t spring-boot-starters spring-boot-starter-amqp \t spring-boot-tools spring-boot-starter-aop – auhuman

0

的原因是你沒有運行「MVN春天啓動:運行」,其中包含帶彈簧引導pom.xml中的目錄下。

相關問題