使用带有播放和scala的Google广告API,您如何正确添加依赖项?

时间:2012-09-12 20:03:15

标签: scala dependencies playframework-2.0 sbt

我正在尝试将谷歌广告API的必要依赖项添加到用scala编写的播放应用中。 我的问题是所有的例子都是针对java的,我不能让它适用于scala。

我一直在看这个设置指南:

https://code.google.com/p/google-api-ads-java/

我从这个网站上获取了sbt的依赖项:

http://mvnrepository.com/artifact/com.google.api-ads

Build.scala:

val appDependencies = Seq(
    //won't work, sbt can't resolve the RELEASE version
    "com.google.api-ads" % "ads-lib" % "RELEASE"
)

val appDependencies = Seq(
    //won't work either, see error below
    "com.google.api-ads" % "ads-lib" % "1.8.0"
)

[warn]  module not found: com.google.api-client#google-api-client;RELEASE              
[warn] ==== local: tried
[warn]   /home/rawphl/Coding/play-2.0.3/framework/../repository/local/com.google.api-     client/google-api-client/RELEASE/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/google/api-client/google-api-client/RELEASE/google-api-client-RELEASE.pom
[warn]  module not found: com.google.oauth-client#google-oauth-client;RELEASE
[warn] ==== local: tried
[warn]   /home/rawphl/Coding/play-2.0.3/framework/../repository/local/com.google.oauth-client/google-oauth-client/RELEASE/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client/RELEASE/google-oauth-client-RELEASE.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::                       
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.google.api-client#google-api-client;RELEASE: not found
[warn]  :: com.google.oauth-client#google-oauth-client;RELEASE: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

我现在不确定如何进行。我想我只是缺少一些依赖项,但我无法弄清楚添加google api的首选方式是什么。

1 个答案:

答案 0 :(得分:1)

使用1.9.0就可以了。更一般地,检查依赖关系,检查版本,随机化值并祈祷。