Maven“无法解析依赖项”对于 openid4java

发布于 2024-11-17 21:23:14 字数 3536 浏览 3 评论 0原文

摘要:
运行“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

把昨日还给我 2024-11-24 21:23:14

我通过将 pom 添加到 pom.xml 解决了这个问题。我在此帖子的 OpenID4Java google 群组中找到了答案。

谷歌群组中的帖子是这样说的:

我的意思是你应该添加
“pom”到依赖项
你的 openid4java 部分
pom.xml:

 <依赖关系>
         org.openid4java;
         openid4java-consumer;
         
         
         
         
         ;
         <版本>0.9.6
         <类型>pom <------------------------这一行不能省略。
    

openid4java-consumer/openid4java-server/....的类型都是“pom”而不是“jar”。 jar 文件位于 openid4java-nodeps 中,它由 openid4java-consumer/openid4java-server 依赖...

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:

I mean you should add
"pom" to the dependency
section of openid4java in your
pom.xml:

   <dependency>
         <groupId>org.openid4java</groupId>
         <artifactId>openid4java-consumer</artifactId>
         <!--artifactId>openid4java-server</artifactId-->
         <!--artifactId>openid4java-infocard</artifactId-->
         <!--artifactId>openid4java-xri</artifactId-->
         <!--artifactId>openid4java</artifactId-->
         <!--artifactId>openid4java-full</artifactId-->
         <version>0.9.6</version>
         <type>pom</type> <-----------------------This line can not be omitted.
    </dependency>

The type of openid4java-consumer/openid4java-server/.... are all "pom" not "jar". The jar file is in openid4java-nodeps which is depended by openid4java-consumer/openid4java-server...

触ぅ动初心 2024-11-24 21:23:14

这就是我让它编译和运行的方法:

  1. 转到您的 m2 或 maven 中央存储库,
  2. org->openID4java->openID4java->0.9.6 并编辑 openid4java-0.9.6.pom 文件并将 pom 添加到没有 jar
  3. org->openID4java->openid4java-consumer-SampleConsumer->0.9.6 的依赖项并编辑 的工件中
  4. openid4java-consumer-SampleConsumer-0.9.6.pom 文件并将 pom 添加到 openId-consumer org->openID4java->openid4java-openid4java-server-SampleServer->0.9.6 并编辑 openid4java-server-SampleServer -0.9.6.pom文件并将pom添加到openId-server的artifact中
  5. org->openID4java->openid4java-server-JdbcServerAssociationStore-0.9.6 并打开 pom 文件并将 pom 添加到 openID-server 工件中。

融合 Eclipse,然后右键单击项目和 Maven 并更新依赖项,您就可以开始了,
对于maven工具用户,直接编译即可开始使用

This is what I did to make it compile and run:

  1. Go to your m2 or maven central repository,
  2. org->openID4java->openID4java->0.9.6 and edit openid4java-0.9.6.pom file and add pom to the dependencies which does not have jar
  3. org->openID4java->openid4java-consumer-SampleConsumer->0.9.6 and edit openid4java-consumer-SampleConsumer-0.9.6.pom file and add pom to the artifact of openId-consumer
  4. org->openID4java->openid4java-openid4java-server-SampleServer->0.9.6 and edit openid4java-server-SampleServer-0.9.6.pom file and add pom to the artifact of openId- server
  5. org->openID4java->openid4java-server-JdbcServerAssociationStore-0.9.6 and open the pom file and add the pom to the openID-server artifact.

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

在巴黎塔顶看东京樱花 2024-11-24 21:23:14

解决 Grails 中的依赖关系的另一种方法是添加 Maven 存储库“https://oss.sonatype.org/content/repositories/openid4java/”并将“openid4java-nodeps”作为工件。

repositories {
    grailsPlugins()
    grailsHome()
    grailsCentral()
    mavenCentral()      
    mavenRepo "https://oss.sonatype.org/content/repositories/openid4java/"
}

dependencies {
    runtime('mysql:mysql-connector-java:5.1.19',
            'org.apache.httpcomponents:httpclient:4.2',
            'org.openid4java:openid4java-nodeps:0.9.6') { excludes "xml-apis" }
}

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.

repositories {
    grailsPlugins()
    grailsHome()
    grailsCentral()
    mavenCentral()      
    mavenRepo "https://oss.sonatype.org/content/repositories/openid4java/"
}

dependencies {
    runtime('mysql:mysql-connector-java:5.1.19',
            'org.apache.httpcomponents:httpclient:4.2',
            'org.openid4java:openid4java-nodeps:0.9.6') { excludes "xml-apis" }
}
如梦初醒的夏天 2024-11-24 21:23:14

引起:org.sonatype.aether.resolution.DependencyResolutionException:无法解析以下工件:org.openid4java:openid4java:jar:0.9.6、org.openid4java:openid4java-consumer:jar:0.9.6、 org.openid4java:openid4java-服务器: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: 失败找到 org.openid4java:openid4java:jar:0.9.6 中

你需要将 添加到包含这些工件的项目中,或者将它们安装到本地存储库。

尝试 https://oss.sonatype.org/content/repositories/openid4java/ (位于 MavenHowTo

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

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)

音盲 2024-11-24 21:23:14

为每个失败的依赖项 openid4java-xxx 执行 Maven 安装包,如下所示:

  1. openid4java-0.9.6 目录中运行 ant 构建任务

  2. 然后执行:

    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-consumer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<>build\openid4java.jar
    
    mvn install:安装文件 -DgroupId=org.openid4java -DartifactId=openid4java-server -Dversion=0.9.6 -Dpackaging=jar -Dfile=<>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-server-JdbcServerAssociationStore -Dversion=0.9.6 -Dpackaging=jar -Dfile=<>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-consumer-SampleConsumer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<>build\openid4java.jar
    
    mvn install:安装文件 -DgroupId=org.openid4java -DartifactId=openid4java-server-SampleServer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<>build\openid4java.jar
    

这样就可以了!

Do the maven install package for every depency openid4java-xxx failed as folow:

  1. run the ant build task inside your openid4java-0.9.6 directory

  2. then execute:

    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-consumer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<<change_this_path_to>>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-server -Dversion=0.9.6 -Dpackaging=jar -Dfile=<<change_this_path_to>>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-server-JdbcServerAssociationStore -Dversion=0.9.6 -Dpackaging=jar -Dfile=<<change_this_path_to>>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-consumer-SampleConsumer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<<change_this_path_to>>build\openid4java.jar
    
    mvn install:install-file -DgroupId=org.openid4java -DartifactId=openid4java-server-SampleServer -Dversion=0.9.6 -Dpackaging=jar -Dfile=<<change_this_path_to>>build\openid4java.jar
    

And that should do it!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文