在哪里获取驱动器API V2和依赖项的Android库(首选Maven)



是否有人想出了在哪里汇编库的库https://develvevelers.google.com/drive/quickstart-android#step_4_set_spec_up_sample?

他们在同一页面上解释了如何通过Eclipse获取驱动器API V2 Libs。我不使用Eclipse,并且使用IDE来获取LIBS并不适合程序员(自动化,构建服务器等)。虽然我找不到有libs的毛ven仓库。实际上,我不确定应该是什么工件名称(或全套罐子)。

任何帮助都将不胜感激。

他们的api maven repo:

<repository>
  <id>googleapis</id>
  <url>http://google-api-client-libraries.appspot.com/mavenrepo</url>
</repository>

和示例依赖性:

<dependency>
  <groupId>com.google.apis</groupId>
  <artifactId>google-api-services-drive</artifactId>
  <version>v2-rev33-1.12.0-beta</version>
</dependency>                                        

他们的Maven仓库不允许列表,但是您可以像这样构建URL来获得罐子:

http://google-api-client-libraries.appspot.com/mavenrepo/com/google/google/apis/google-api-api-services-services-services-services-drive/v2-rev333-1.12.0-beta/google-api-services-drive-v2-rev33-1.12.0-beta.jar

所有Google API都在那里:http://code.google.com/p/google-api-java-client/

不幸的是,根据我自己的搜索,驱动器SDK V2仍在Beta(2012年12月)中,并且仅通过Eclipse提供。

问候

编辑:查看这里!!!

最后,我想出了如何使用Maven的Google Drive Libs。

Google Drive所需的Google客户端API库位于Maven Central中。实际上,Google Code Maven Repo中有1.8.0版的Google API服务V2 LIB。该存储库应包含在pom.xml中:

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

除了Google Drive库本身,还需要一些基本API库。这是用于桌面的MVN:

    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.12.0-beta</version>
    </dependency>
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson</artifactId>
        <version>1.12.0-beta</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev13-1.8.0-beta</version>
    </dependency>

在Android上,更多的依赖性是需要的,XPP3的依赖性也应排除在外。还需要与Google-Services依赖关系进行一些握手。

    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client</artifactId>
        <version>1.12.0-beta</version>
        <exclusions>
            <exclusion>
                <artifactId>xpp3</artifactId>
                <groupId>xpp3</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson</artifactId>
        <version>1.12.0-beta</version>
        <exclusions>
            <exclusion>
                <artifactId>xpp3</artifactId>
                <groupId>xpp3</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client-android</artifactId>
        <version>1.12.0-beta</version>
        <exclusions>
            <exclusion>
                <artifactId>xpp3</artifactId>
                <groupId>xpp3</groupId>
            </exclusion>
            <exclusion>
                <artifactId>google-play-services</artifactId>
                <groupId>com.google.android.google-play-services</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.syncloud</groupId>
        <artifactId>google-play-services</artifactId>
        <version>4-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev13-1.8.0-beta</version>
    </dependency>

从Maven Central的Google-api-Client-android库中引用了Google-Play-Services。尽管Maven Central既没有真实的也没有固定罐。因此,您必须排除此依赖性。但是,您仍然必须提供此罐子。您可以通过Android SDK Manager下载并安装到Maven存储库中。在我的情况下,我在org.sonatype maven存储库中引用了Google-Services版本4(姜饼)。

对于使用最新的Google Drive V2库,将必须通过Eclipse下载它们并安装到Maven存储库。这就是我在Syncloud项目中所做的:

    <dependency>
        <groupId>org.syncloud</groupId>
        <artifactId>google-api-services-drive</artifactId>
        <version>v2-rev33-1.12.0-beta-SNAPSHOT</version>
    </dependency>

结论:可以在Android上使用Maven的Google Drive V2库。尽管您首先应该完全了解Google Drive库和Google API客户端库之间的所有依赖关系。此外,您还必须将一些库安装到Maven上,因为最新的Google Drive Library和Google Play Services Library并未由Google安装到任何Maven。

如果Google Drive开发团队的任何人正在阅读此帖子,请缓解Maven中缺少图书馆的痛苦。

有一个用于日食的Google插件。因此,您可以导入所有Google API。只需在Eclipse Marketplace中检查一下即可。

编辑

这是插件的链接

最新更新