我看到这个仍然没有答案OP原本想,所以尽管它是一个年纪大一点,这里是为未来的Google:
从https://developers.google.com/mobile-ads-sdk/download
在你的pom将这个下载的罐子。 XML(当然,相应的版本):
<dependency>
<groupId>com.admob.android</groupId>
<artifactId>ads</artifactId>
<version>6.4.1</version>
</dependency>
,然后在你的外壳,相应的版本/罐名运行此,再次:
mvn install:install-file -Dfile=GoogleAdMobAdsSdk-6.4.1.jar -Dversion=6.4.1 -DartifactId=ads -DgroupId=com.admob.android -DgeneratePom=true -Dpackaging=jar
请注意,上述命令的版本需要在两处更改 - 一次在文件名中,一次在-Dversion参数中。
在您的项目中包含最新版本的库并在依赖项上方的pom.xml中包含以下内容也可能是一个好主意,因为这不是您可能记住的步骤你必须谷歌;)
<!-- If you just set up your dev system and the following dependency gives you an error,
run these commands:
cd project-root
mvn install:install-file -Dfile=libs/GoogleAdMobAdsSdk-6.4.1.jar -Dversion=6.4.1 -DartifactId=ads -DgroupId=com.admob.android -DgeneratePom=true -Dpackaging=jar
-->
我宁愿将它安装到我的本地回购,所以我可以在其他项目中使用,我该怎么做? – Jimmy 2011-02-28 19:37:53
请记住,您用于开发的所有开发人员/计算机都需要经过这一步骤,因为我的建议可以避免此问题:http://maven.apache.org/plugins/maven-install-plugin/usage。 html – 2011-02-28 20:16:36
不幸的是,这似乎并不奏效,请参阅http://stackoverflow.com/questions/4960954/android-admob-and-maven – futlib 2011-06-04 05:25:05