找不到 Google API 使用地图的 Maven 依赖项 [英] Cant find maven dependency for Google APIs to use maps

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

问题描述

我正在尝试使用 maven 来管理我的依赖项和构建过程.我在查找 Google API 依赖项或地图依赖项时遇到问题.这很好用(没有地图 api):

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,地图 jar 文件目前在任何在线 maven 存储库中都不可用.

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

使用 Android SDK Manager 下载所需的地图 jar 文件,然后手动将其安装到本地 maven 存储库:

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]

或者使用 Manfred 的 maven-android-sdk-deployer 将所有 Android SDK jar 文件安装到本地Maven 仓库.

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

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

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>

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

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