且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到 Google API 使用地图的 Maven 依赖项

更新时间:2021-09-21 06:35:52

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>