我可以使用AdMob SDK罐子作为依赖于我的Maven的Andr​​oid项目? [英] Can I use the AdMob SDK jar as a dependency in my maven android project?

查看:159
本文介绍了我可以使用AdMob SDK罐子作为依赖于我的Maven的Andr​​oid项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是交换我的构建过程中使用Maven,我找不到在Maven仓库网站AdMob广告的依赖,我怎么可以手动配置呢?

如:

 <依赖和GT;
        <&依赖性GT;
            <&的groupId GT; com.google.android< /的groupId>
            <&的artifactId GT; Android设备和LT; / artifactId的>
            <&版GT; 2.2.1< /版本>
            <&范围GT;及提供LT; /&范围GT;
        < /依赖性>
    < /依赖和GT;


解决方案

这是简单的方法来做到这一点是有lib目录中的源代码树,并使用这样的:

  ...
<&依赖性GT;
  <&的groupId GT; some_admob_groupid< /的groupId>
  <&的artifactId GT;的AdMob< / artifactId的>
  <&版GT; admob_version< /版本>
  <&范围GT;系统和LT; /&范围GT;
  &LT; Systempath下&GT; $ {BASEDIR} /lib/admob.jar</systemPath>
&LT; /依赖性&GT;
...

当然,你需要改变的groupId,artifactId的,版本和Systempath下,以满足您的需求,但这种方法可以让你在你的pom.xml作为依赖当地的.jar没有它安装到你的资料库。

I'm just switching my build process to use maven, I can't find the dependency for AdMob on the maven repository site, how can I configure it manually?

Such as :

<dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

解决方案

An easy way to do this is to have the lib in your source tree and use this:

...
<dependency>
  <groupId>some_admob_groupid</groupId>
  <artifactId>admob</artifactId>
  <version>admob_version</version>
  <scope>system</scope>
  <systemPath>${basedir}/lib/admob.jar</systemPath>
</dependency>
...

Of course you need to change the groupId, artifactId, version and systemPath to suit your needs but this approach lets you have a local .jar in your pom.xml as a dependency without installing it to your repository.

这篇关于我可以使用AdMob SDK罐子作为依赖于我的Maven的Andr​​oid项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆