不能找到行家依赖于谷歌的API使用地图 [英] Cant find maven dependency for Google APIs to use maps

查看:233
本文介绍了不能找到行家依赖于谷歌的API使用地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用maven来管理我的依赖关系和构建过程。我有一个问题,找到谷歌API的依赖或地图的依赖。这工作正常(不含地图API):

 <依赖>
    <的groupId> com.google.android< /的groupId>
    < artifactId的>的android< / artifactId的>
    <版> 4.0.1.2< /版本>
    <范围>提供与LT; /范围>
< /依赖性>
 

解决方案

AFAIK,地图jar文件不在此刻任何在线Maven仓库中可用。

要么使用Android的SDK管理器中下载所需的地图jar文件,然后手动将它安装到你的本地仓库:

  MVN安装:安装文件-Dfile =您的神器 -  1.0.jar \
    [-DgroupId = org.some.group] \
    [-DartifactId =你的神器] \
    [-Dversion = 1.0] \
    [-Dpackaging =罐子]
 

或者使用曼弗雷德的 Maven的Andr​​oid的SDK-部署所有的Andr​​oid SDK的jar文件安装到本地仓库。

然后就可以开始在pom.xml中使用它:

 <依赖>
    <的groupId> com.google.android.maps< /的groupId>
    < artifactId的>地图< / artifactId的>
    <版> 4_r2< /版本>
    <范围>提供与LT; /范围>
< /依赖性>
 

I'm trying to use maven to manage my dependencies and build process. I have a problem to find the Google API dependency or the maps dependency. This works fine (without maps api):

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>4.0.1.2</version>
    <scope>provided</scope>
</dependency>

解决方案

AFAIK, map jar files are not available in any online maven repository at the moment.

Either use Android SDK Manager download the required map jar file then manually install it to you local maven repository:

mvn install:install-file -Dfile=your-artifact-1.0.jar \
    [-DgroupId=org.some.group] \
    [-DartifactId=your-artifact] \
    [-Dversion=1.0] \
    [-Dpackaging=jar]

Or use Manfred's maven-android-sdk-deployer install all Android SDK jar files to your local maven repository.

Then you can start using it in pom.xml:

<dependency>
    <groupId>com.google.android.maps</groupId>
    <artifactId>maps</artifactId>
    <version>4_r2</version>
    <scope>provided</scope>
</dependency>

这篇关于不能找到行家依赖于谷歌的API使用地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆