10

I'm trying to follow this guide here http://www.ibm.com/developerworks/web/library/wa-oauthsupport/index.html which gives information on how to use the OAuth client library provided by OAuth and HTTPClient 4 to authenticate your connection. I am working on a Java Swing CLIENT, NOT a OAuth PROVIDER.

OAuth provides a client library here on this page http://oauth.net/code/

I'm talking about the one marked by "A Java library and examples were contributed by John Kristian, Praveen Alavilli and Dirk Balfanz." which points to an SVN repository http://oauth.googlecode.com/svn/code/java/core/

I do not understand how to incorporate this library into my Eclipse project. I would like to just be able to add a maven dependency because it's so clean and works so well. I don't see coordinates readily available, and when I look at http://oauth.googlecode.com/svn/code/java/pom.xml I see the following coordinates but they don't work when I run the Maven build with the coordinates, and I get a "Missing artifact net.oauth:oauth-parent:jar:20100601" error in Eclipse's integrated Maven 3 pom.xml manager. I thought the entire point of Mavenizing a project was so that you could use its coordinates to pull it in.

<dependency>
    <groupId>net.oauth</groupId>
    <artifactId>oauth-parent</artifactId>
    <version>20100601</version>
    <packaging>pom</packaging>
</dependency>

I've tried the follow dependency after snooping around on the maven repository, and it didn't have all the classes/interfaces/etc I needed.

<dependency>
    <groupId>net.oauth.core</groupId>
    <artifactId>oauth</artifactId>
    <version>20100527</version>
</dependency>

Is this the wrong way to incorporate this project? Is it not truly mavenized in a way that makes it easy to share? If I can't use Maven, what's the best path to follow to include this library into my project?

This is a bit of a repeat of How to include oauth library in Eclipse? but that question doesn't address the Maven aspect of it at all.

2 Answers 2

9

The OAUth libs doesn't seem to be available in Maven Central, so you have to add the following repository either to your settings.xml or to your pom.xml:

<repository>
  <id>oauth</id>
  <name>OAuth Repository</name>
  <url>http://oauth.googlecode.com/svn/code/maven</url>
</repository>
4
  • 1
    What dependency entry would you add along with this repository entry?
    – Jazzepi
    Aug 1, 2012 at 4:38
  • <groupId>net.oauth.core</groupId> <artifactId>oauth</artifactId> <version>20100527</version> seems to be the latest, so i would take this
    – dunni
    Aug 1, 2012 at 8:14
  • 1
    As of today this repository URL is giving a 404-PageNotFound response. Would anyone know of an alternative? Thank you.
    – sudeep
    May 13, 2016 at 3:54
  • That's five years old - ancient in this age. Oct 2, 2017 at 16:47
2

I actually found the way to make it work with exactly your version of oauth-parent:

Create a directory and enter it:

mkdir oauth && cd oauth

Checkout code for your version:

svn co http://oauth.googlecode.com/svn/code/java/

Enter checked out directory (java), compile and deploy jars yourself:

cd java && mvn source:jar install

After that your dependency will work:

<dependency>
    <groupId>net.oauth</groupId>
    <artifactId>oauth-parent</artifactId>
    <version>20100601</version>
    <packaging>pom</packaging>
</dependency>
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.