tgr
tgr

Reputation: 3608

What maven dependency do I need to get FileCredentialStore?

I want to get access to google-analytics via the java api (v3). For logging in I want to use OAuth2. I found a java example, that shows how to do it. Unfortunately I am not able to compile the code I copied. It seems that I have no dependency for FileCredentialStore. My Pom looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>de.import.google</groupId>
  <artifactId>analyticsImporter</artifactId>
  <version>0.1</version>
  <name>Analytics Importer</name>
  <dependencies>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-analytics</artifactId>
      <version>v3-rev41-1.14.2-beta</version>
    </dependency>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-oauth2</artifactId>
      <version>v2-rev36-1.14.2-beta</version>
    </dependency>
    <dependency>
      <groupId>com.google.api.client</groupId>
      <artifactId>google-api-client</artifactId>
      <version>1.3.1-alpha</version>
    </dependency>
  </dependencies>
</project>

What am I missing?

Upvotes: 1

Views: 782

Answers (4)

Xavi L&#243;pez
Xavi L&#243;pez

Reputation: 27880

You seem to be missing the dependency for the Java 6 (and higher) Extensions to the Google OAuth Client Library for Java artifact:

<dependency>
    <groupId>com.google.oauth-client</groupId>
    <artifactId>google-oauth-client-java6</artifactId>
    <version>1.14.1-beta</version>
</dependency>

It does have the class FileCredentialStore.

Upvotes: 2

Juned Ahsan
Juned Ahsan

Reputation: 68715

I think you are missing the maven dependency for OAuth2 which actually contains the FileCredentialStore class. Check if this works?

<dependency>
    <groupId>com.google.api-client</groupId>
    <artifactId>google-api-client-java6</artifactId>
    <version>1.12.0-beta</version>
</dependency>

Upvotes: 1

WeMakeSoftware
WeMakeSoftware

Reputation: 9162

Perhaps this one

google-oauth-client-java6 or google-oauth-client-java6

I recommend to use http://grepcode.com . Just search for the class name.

Upvotes: 0

Related Questions