3

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>
JJD
  • 50,076
  • 60
  • 203
  • 339
GedankenNebel
  • 2,437
  • 5
  • 29
  • 39
  • 1
    Search for it on http://grepcode.com/ , you may need to change your version numbers to match the versions published on the public repositories – crowne Apr 30 '12 at 16:24

2 Answers2

15

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>
yorkw
  • 40,926
  • 10
  • 117
  • 130
  • thx yorkw, this worked for me! (manually installed to my local mvn repo) – GedankenNebel May 01 '12 at 20:18
  • Reason why it is not yet available online, see [here](http://stackoverflow.com/questions/13547469/why-android-versions-on-maven-central-dont-include-google-apis-maps/13736969#13736969). – yorkw Jan 21 '13 at 21:50
6

You can also use this project which will install the google api jars into your local maven repository: https://github.com/mosabua/maven-android-sdk-deployer

To install the jars for version 4.0.3 you just need to type:

mvn install -P 4.0.3
Wojciech Górski
  • 945
  • 11
  • 29