Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
887 views
in Technique[技术] by (71.8m points)

android - Cant find maven dependency for Google APIs to use maps

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...