Maven "Failed to resolve dependencies" for openid4java

Summary:
Running "mvn war: war" fails with errors, including:
"The following artifacts cannot be resolved: org.openid4java: openid4java: jar: 0.9.6."

I would call it that I am Maven noob, but I see that other people have sent to openid4java a website containing banks that are missing from the Maven center for openid4java.

Details:
I am trying to speed up work with openid4java by running the Simple-OpenID sample application 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 says: "War mvn war: war must create a war file that can be deployed by copying the war file."

So far, I have met Ant and Mavent Ant tasks, but I decided that today I would bite a bullet and install Maven 3.0.3. I followed the installation instructions and now I can successfully run "mvn -version"

When I run the "mvn war: war" command, some files are really uploaded to my local repository, but the build ultimately failed with the following open 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 boxes actually missing from the Maven repository?

+4
source share
5 answers

I was able to solve this problem by adding <type>pom</type> to pom.xml. I found the answer in the google group OpenID4Java in this thread .

Here is the thread in the google group said:

I want to add "pom" for the openid4java section dependency 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> 

Type openid4java-consumer / openid4java-server / .... all pom are not jar. The jar file is located in openid4java-nodeps, which depends on openid4java-consumer / openid4java-server ...

+4
source

Calls: org.sonatype.aether.resolution.DependencyResolutionException: the following artifacts cannot 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-SampleSerer : jar: 0.9.6: Could not find org.openid4java: openid4java: jar: 0.9.6 in

You need to either add <repository> to your project containing these artifacts, or install them in a local repository.

Try https://oss.sonatype.org/content/repositories/openid4java/ (found in MavenHowTo )

+1
source

This is what I did to compile and run:

  • Go to the central repository of m2 or maven,
  • org-> openID4java-> openID4java-> 0.9.6 and edit the openid4java-0.9.6.pom file and add pom to the dependencies that don't have jar
  • org-> openID4java-> openid4java-consumer-SampleConsumer-> 0.9.6 and edit the file openid4java-consumer-SampleConsumer-0.9.6.pom and add pom to the openId-consumer artifact
  • org-> openID4java-> openid4java-openid4java-server-SampleServer-> 0.9.6 and edit the file openid4java-server-SampleServer-0.9.6.pom and add pom to the openId server artifact
  • org-> openID4java-> openid4java-server-JdbcServerAssociationStore-0.9.6 and open the pom file and add pom to the openID server artifact.

fusing Eclipse, then right-click the project, and maven and the dependency on updates are you ready to work, for the user maven tool, directly compile and you are ready to roll

+1
source

Another way to resolve dependency in Grails is to add the maven repository "https://oss.sonatype.org/content/repositories/openid4java/" and set "openid4java-nodeps" as an 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" } } 
+1
source

Does the maven installation package install for each openid4java-xxx parameter as below:

  • run the ant build task in the openid4java-0.9.6 directory

  • then do:

     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 it must be!

0
source

All Articles