不能找到行家依赖于谷歌的API使用地图行家、地图、依赖于、API

2023-09-05 02:47:53 作者:深知你是梦却不愿醒来i

我想用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; /范围>
< /依赖性>
 
基于百度地图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, 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>