java – Maven usage of google api

java – Maven usage of google api

It seems that the seemingly very beta-ish google-api-services-calendar:v3-rev20-1.12.0-beta isnt pushed to the sontaype repository yet, but if you try to include both the recommended repo and the one mentioned under the Calendar API in your POM:

<repositories>
    <repository>
        <id>google-api-services</id>
        <url>https://oss.sonatype.org/content/repositories/releases/</url>
    </repository>
    <repository>
        <id>google-api-services-beta</id>
        <url>http://google-api-client-libraries.appspot.com/mavenrepo</url>
    </repository>
</repositories>

Also, the following additional dependencies seem to be necessary:

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

Hope that helps.

I had adventure with google custom search api. Most of the problem were due to unavailability of mvn repo http://google-api-client-libraries.appspot.com/mavenrepo.

Custom search jar I took from:

<repository>
  <id>google-api-services</id>
  <url>http://mavenrepo.google-api-java-client.googlecode.com/hg</url>
</repository>

It was in pom inside the jar downloaded manually. Newest google-api-client and google-http-client-jackson (at 1.13.2-beta JacksonFactory is an additional dependency) were in central maven repo.

java – Maven usage of google api

As of a few months ago, Google started pushing libraries to the Sonatype repo. You no longer should include a repository entry in your pom.xml pointing to google-api-client-libraries.appspot.com/mavenrepo or mavenrepo.google-api-java-client.googlecode.com

Doing that slows down your builds because you end up checking for all dependencies (even non Google ones) at that repository. These checks 404, then you check the master repository.

Leave a Reply

Your email address will not be published.