Maven“无法解析依赖项”对于 openid4java
摘要:
运行“mvn war:war”失败,错误包括:
“无法解析以下工件:org.openid4java:openid4java:jar:0.9.6”。
我认为这是因为我是 Maven 菜鸟,但我看到其他人已经发布到 openid4java 网站指出 Maven 中心jar 丢失 openid4java。
详细信息:
我试图通过运行最新版本的 openid4java (0.9.6.662) 中包含的 Simple-OpenID 示例应用程序来加快使用 openid4java 的速度。
根据自述文件“此演示需要 apache Maven2 来构建”。自述文件还指出“mvn war:war 任务应该创建一个可以通过复制 war 文件来部署的 war 文件”。
到目前为止,我一直在使用 Ant 和 Mavent Ant 任务,但我想我今天应该硬着头皮安装 Maven 3.0.3。我按照安装说明操作,现在可以成功运行“mvn --version”
当我运行“mvn war:war”时,许多文件确实被下载到我的本地存储库,但最终构建失败,并显示以下摘录消息:
[ERROR] Failed to execute goal on project simple-openid: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 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 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project simple-openid: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 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.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:196)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 in
我是吗这里做错了什么,或者 Maven 存储库中实际上缺少 jar 吗?
Summary:
Running "mvn war:war" fails with errors including:
"The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6".
I'd chalk it up to the fact that I'm a Maven noob but I see that other people have posted to the openid4java web site stating jars are missing from Maven central for openid4java.
Details:
I'm trying to get up to speed with openid4java by running the Simple-OpenID sample app that's included in the latest version of openid4java (0.9.6.662).
According to the Readme "This demo requires apache Maven2 to build". The Readme also states "The mvn war:war task should create a war file which can be deployed by copying the war file".
Up to now I've been getting by with Ant and the Mavent Ant Tasks but I figured I'd bite the bullet today and install Maven 3.0.3. I followed the install instructions and can now successfully run "mvn --version"
When I run "mvn war:war" a number of files do indeed get downloaded to my local repository but ultimately the build fails with the following excerpted message:
[ERROR] Failed to execute goal on project simple-openid: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 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 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project simple-openid: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 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.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:196)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.openid4java:simple-openid:war:0.9.6: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.openid4java:openid4java:jar:0.9.6, org.openid4java:openid4java-consumer:jar:0.9.6, org.openid4java:openid4java-server:jar:0.9.6, org.openid4java:openid4java-server-JdbcServerAssociationStore:jar:0.9.6, org.openid4java:openid4java-consumer-SampleConsumer:jar:0.9.6, org.openid4java:openid4java-server-SampleServer:jar:0.9.6: Failure to find org.openid4java:openid4java:jar:0.9.6 in
Am I doing something wrong here or are the jars actually missing from the Maven repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我通过将
pom
添加到 pom.xml 解决了这个问题。我在此帖子的 OpenID4Java google 群组中找到了答案。谷歌群组中的帖子是这样说的:
I was able to resolve this problem by adding
<type>pom</type>
to the pom.xml. I found the answer in the OpenID4Java google group in this thread.Here's what the thread in the google group said:
这就是我让它编译和运行的方法:
融合 Eclipse,然后右键单击项目和 Maven 并更新依赖项,您就可以开始了,
对于maven工具用户,直接编译即可开始使用
This is what I did to make it compile and run:
fusing Eclipse, then right click project and maven and update dependency you are ready to go,
for maven tool user, directly compile and you are ready to roll
解决 Grails 中的依赖关系的另一种方法是添加 Maven 存储库“https://oss.sonatype.org/content/repositories/openid4java/”并将“openid4java-nodeps”作为工件。
Another way to resolve the dependency in Grails is to add maven repository "https://oss.sonatype.org/content/repositories/openid4java/" and put "openid4java-nodeps" as the artifact.
你需要将
添加到包含这些工件的项目中,或者将它们安装到本地存储库。尝试 https://oss.sonatype.org/content/repositories/openid4java/ (位于 MavenHowTo)
You need to either add a
<repository>
to your project containing these artifacts or install them to your local repository.Try https://oss.sonatype.org/content/repositories/openid4java/ (found at MavenHowTo)
为每个失败的依赖项
openid4java-xxx
执行 Maven 安装包,如下所示:在
openid4java-0.9.6
目录中运行 ant 构建任务然后执行:
这样就可以了!
Do the maven install package for every depency
openid4java-xxx
failed as folow:run the ant build task inside your
openid4java-0.9.6
directorythen execute:
And that should do it!