【发布时间】:2013-05-25 14:56:27
【问题描述】:
更新:这不会/不应再发生,请参阅已接受的答案。如果您在使用其他 jar 时遇到此问题,则通常是暂时的。您可以尝试其他答案中建议的一些解决方法。
我正在遵循Jersey 2.0 user guide 的指示。当我达到 1.3(运行项目,我得到以下失败:
[ERROR] Failed to execute goal on project xxx-service: Could not resolve dependencies for project xxx.restapi:xxx-service:jar:1.0-SNAPSHOT: Failure to find javax.annotation:javax.annotation-api:jar:1.2 in https://maven.java.net/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of snapshot-repository.java.net has elapsed or updates are forced -> [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/DependencyResolutionException
问题好像是没有https://maven.java.net/content/groups/public/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
如果我们转到https://maven.java.net/content/groups/public/javax/annotation/javax.annotation-api/,我们会看到这些文件夹中的文件夹和jar 文件被重命名为-b01 等后缀。
pom 本身没有任何直接引用这个注解 jar。所以我想问题是:我如何调整这种依赖关系?我应该在 POM 文件中放入什么才能正确解决该依赖关系?
【问题讨论】: