2013-07-29 108 views
2

我正在开发基于maven的项目,我没有任何Maven的经验。 目前我正在尝试执行maven + robospice示例 https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-spring-android。 我面临着一个奇怪的依赖错误“缺少神器com.octo.android.robospice:robospice - 弹簧 - 安卓的jar:1.4.5-快照”的依赖pom.xml中的Maven依赖项错误

<dependency> 
     <groupId>com.octo.android.robospice</groupId> 
     <artifactId>robospice-spring-android</artifactId> 
     <version>${robospice.spring.android.version}</version> 
    </dependency> 

变量{robospice.spring。 andriod.version}的值为1.4.5-SNAPSHOT。 完整的pom.xml在这里可用https://github.com/octo-online/RoboSpice-samples/blob/release/robospice-sample-spring-android/pom.xml

我已经执行了mvn clean install,我也更新了mvn​​ update项目,但是这个错误仍然存​​在。 请帮我解决它。

感谢,

回答

3

你的解决方案应该是使用:

<robospice.spring.android.version>1.4.6</robospice.spring.android.version> 

代替:

<robospice.spring.android.version>1.4.5-SNAPSHOT</robospice.spring.android.version> 

原因看起来很简单,这个例子可能已经过时了。因为已经有更新的版本正式发布。你可以在官方的maven中央仓库上看到它:http://mvnrepository.com/artifact/com.octo.android.robospice/robospice-spring-android

作为背景。 Maven以某种方式使用版本控制,只需在pom.xml文件中描述这些文件即可检索应用程序依赖的库(依赖项)。这些随后从Maven仓库下载(默认为maven中央仓库)。有关完整信息,请参阅:http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

+1

其固定,谢谢, –