简体   繁体   English

pom.xml中的Maven依赖错误

[英]Maven Dependency Error in pom.xml

I am working on a maven based project in android, I don't have any prior experience with maven. 我在android中基于Maven的项目上工作,我没有使用过Maven的任何经验。 Currently i am trying to execute maven + robospice sample https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-spring-android . 目前,我正在尝试执行Maven + robospice示例https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-spring-android I am facing a strange dependency error "Missing artifact com.octo.android.robospice:robospice-spring-android:jar:1.4.5-SNAPSHOT" on dependency 我在依赖项上遇到了一个奇怪的依赖项错误“缺少工件com.octo.android.robospice:robospice-spring-android:jar:1.4.5-SNAPSHOT”

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

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

I have executed mvn clean install, i also have updated mvn update project but this error is still exist. 我已经执行了mvn全新安装,我也更新了mvn​​更新项目,但此错误仍然存​​在。 please help me to fix it. 请帮助我修复它。

Thanks, 谢谢,

the solution for you should be to use: 您应该使用的解决方案是:

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

instead of: 代替:

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

the reason seems simple, the example might be outdated. 原因似乎很简单,该示例可能已过时。 as there is already later version officially released. 因为已经有更高版本正式发布了。 You can see it on official maven central repository: http://mvnrepository.com/artifact/com.octo.android.robospice/robospice-spring-android 您可以在官方Maven中央存储库上看到它: http : //mvnrepository.com/artifact/com.octo.android.robospice/robospice-spring-android

As a background. 作为背景。 Maven uses versioning in a way, that you can retrieve libraries your application depends on (dependencies) just by describing these in your pom.xml file. Maven使用版本控制的方式是,您可以仅通过在pom.xml文件中进行描述来检索应用程序所依赖的库(依赖项)。 These are later downloaded from the maven repositories (by default maven central repository). 稍后从maven存储库(默认情况下为maven中央存储库)下载这些文件。 For full info, see: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html 有关完整信息,请参见: http : //maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

I am not able to see any jar with that version 1.4.5-SNAPSHOT in Maven Central Repository. 我在Maven中央存储库中看不到任何带有该版本1.4.5-SNAPSHOT的jar。 Please try with version 1.4.5 请尝试使用1.4.5版

For more you can refer here 欲了解更多信息,请点击这里

http://search.maven.org/#browse|-1465358918 http://search.maven.org/#browse|-1465358918

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM