1

我正在尝试将谷歌广告 api 的必要依赖项添加到用 scala 编写的播放应用程序中。我的问题是所有示例都是针对 java 的,我无法让它为 scala 工作。

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

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

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

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

构建.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 的首选方式是什么。

4

1 回答 1

1

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

于 2012-10-05T17:21:34.020 回答