2014-08-29 129 views
1

我刚刚克隆GitHub的回购为Spring Boot samples,我试图运行各种样品,但他们都返回相同的错误:错误运行弹簧引导样品

c:\temp\spring-boot\spring-boot-samples\spring-boot-sample-web-jsp>mvn package 
[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Spring Boot Web JSP Sample 1.2.0.BUILD-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[WARNING] The POM for org.springframework.boot:spring-boot-maven-plugin:jar:1.2.0.BUILD-SNAPSHOT is missing, no dependency information available 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.197s 
[INFO] Finished at: Fri Aug 29 11:57:22 BST 2014 
[INFO] Final Memory: 3M/183M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:1.2.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Failed to read 
artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:1.2.0.BUILD-SNAPSHOT: Could not find artifact org.springframework.boot: 
spring-boot-maven-plugin:pom:1.2.0.BUILD-SNAPSHOT -> [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/PluginResolutionException 

我错过了什么?我需要为Spring Boot添加一个回购吗?主Maven回购中唯一的Spring Boot artifacts都是1.1.5.RELEASE。如果我用1.1.5.RELEASE代替1.2.0.BUILD-SNAPSHOT,它会生成;但是毫不奇怪的是,这并不意外。

+1

在构建样例之前,您需要首先构建依赖关系,例如在您的案例中构建工具。我建议你通过父母的pom建立一切,然后你可以继续尝试构建独立的模块。在你的情况下,maven插件“1.2.0.BUILD-SNAPSHOT”丢失。 – 2014-08-29 11:55:07

回答

2

我从1.1.5.RELEASE更新时遇到同样的问题。

我从spring-boot目录运行mvn install

花了1小时10分钟!

让我知道这是否修复它!

+0

我意识到这一点,感谢来自ripudam对我的问题的评论。 Spring文档可以让你更清楚地知道,在运行样本之前,你需要先做这件事。 'mvn install'将首先执行一个'package'。 – Mark 2014-09-11 08:16:35

1

你有像这个link指向快照回购的pom文件吗? repo link具有列出的maven插件内容。

<repositories> 
    <repository> 
     <id>spring-snapshots</id> 
     <url>http://repo.spring.io/snapshot</url> 
     <snapshots><enabled>true</enabled></snapshots> 
    </repository> 
    <repository> 
     <id>spring-milestones</id> 
     <url>http://repo.spring.io/milestone</url> 
    </repository> 
</repositories> 
<pluginRepositories> 
    <pluginRepository> 
     <id>spring-snapshots</id> 
     <url>http://repo.spring.io/snapshot</url> 
    </pluginRepository> 
    <pluginRepository> 
     <id>spring-milestones</id> 
     <url>http://repo.spring.io/milestone</url> 
    </pluginRepository> 
</pluginRepositories>