Add Google Analytics Library to a Maven Project

android, google-analytics, maven

Solution

You can install all missing android libs using maven-android-sdk-deployer. It installs all extras in local maven repository from android sdk folder. Usage is quite simply: download and run `mvn install`. Deployer itself doesn't support optional dependencies other than sdk version. You must install all jars via SDK Manager at first.

Update: Upon writing this answer Google has landed updates to SDK Manager and included 2 maven repositories in it: `Google Repository` and `Android Support Repository`. All you have to do is add them to repositories list in `pom.xml`. It provides following artifacts:

- support library (v4, v13)

- gridlayout (v7)

- google play services (3.1.36)

As you can see it doesn't have analytics artifacts, so you still need `maven-android-sdk-deployer`

Problem

Where I can find the Google Analytics Android lib `groupId` and `archetype` for my projects pom? I've been searching for it for a couple of hours, and I can't find any clue...( P.S. I found something on GitHub, but it seam like it uses an third-party repository (when I try to run `mnv install` or `compile` it gives me an error): ``` <dependency> <groupId>com.google.android.analytics</groupId> <artifactId>analytics</artifactId> <version>2</version> </dependency> ```

Original source

Related problems