Add Admob jar to local Maven Repository

I do not find the dependency declaration for googles Admob at Maven Central.
Download the jar https://developers.google.com/mobile-ads-sdk/download#downloadandroid
Install AdMob in my local m2 Repository to use the Dependency

ingoreschke$cd Downloads/GoogleAdMobAdsSdkAndroid-6.4.1/
ingoreschke$ mvn install:install-file -Dfile=GoogleAdMobAdsSdk-6.4.1.jar 
-DgroupId=com.google.ads
-DartifactId=admob 
-Dversion=6.4.1 
-Dpackaging=jar

refer it in your pom using

<dependency>
	<groupId>com.google.ads</groupId>
	<artifactId>admob</artifactId>
	<version>6.4.1</version>
</dependency>

Source:
http://stackoverflow.com/questions/12873586/how-to-download-and-install-jar-in-my-local-repo-maven

Alternativly you can create a helper POM in same directory

<?xml version="1.0" encoding="UTF-8"?>
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.ingoreschke</groupId>
    <artifactId>install-admob</artifactId>
    <version>1.0.0</version>
    <!--Helper POM for installing admob to local repo-->
    <build>
        <defaultGoal>install:install-file</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <file>GoogleAdMobAdsSdk-6.4.1.jar</file>
                    <groupId>com.google.ads</groupId>
                    <artifactId>admob</artifactId>
                    <packaging>jar</packaging>
                    <version>6.4.1</version>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

call mvn

mvn

Source:
http://www.michenux.net/android-admob-tutorial-461.html

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>