为什么我的maven找不到条带库?

时间:2013-02-16 03:59:56

标签: java maven intellij-idea

使用intellij我可以看到我的外部库中的包,但是当我使用maven构建时,我得到以下问题:

运行时:

mvn clean package

我收到此错误:

Failure to find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

版本为:

<stripe-version>1.1.16</stripe-version>

我也尝试了1.1.13和1.1.14,我也得到了同样的错误。

使用-e开关运行时,我得到:

Failure to find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:170)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:171)
    ... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Failure to find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:412)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:164)
    ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
    ... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
    at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:190)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:430)
    ... 26 more

我可以在这里看到版本:http://search.maven.org/#browse%7C788949441

1 个答案:

答案 0 :(得分:2)

依赖关系下载得很好:

<dependency>
    <groupId>com.stripe</groupId>
    <artifactId>stripe-java</artifactId>
    <version>1.1.16</version>
</dependency>

似乎您在定义/使用条带版本属性时遇到问题:

<properties>
    <stripe.version>1.1.16</stripe.version>
</properties>

<!--- ... -->
<version>${stripe.version}</version>