无法在Play框架中找到com.typesafe.play。

huangapple go评论61阅读模式
英文:

Could not find com.typesafe.play in play framework

问题

以下是您要翻译的内容:

我对Play框架不熟悉。我正在尝试构建我公司的一个旧项目(我是一名实习生)。
以下是日志内容:

* 出现了什么问题:
任务':compileJava'执行失败。
> 无法解析配置':compileClasspath'的所有文件。
   > 找不到com.typesafe.play:play-java-2.12:2.6.6。
     在以下位置搜索:
       - https://repo.maven.apache.org/maven2/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://jcenter.bintray.com/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://repo.lightbend.com/lightbend/maven-releases/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://repo.lightbend.com/lightbend/ivy-releases/com.typesafe.play/play-java-2.12/2.6.6/ivys/ivy.xml
     所需版本:
         项目:

我的build.gradle中的代码(我公司使用gradle而不是sbt):

compile group: "com.typesafe.play", name: "play_$scalaVersion", version: "$playVersion"
compile group: "com.typesafe.play", name: "routes-compiler_$scalaVersion", version: "$playVersion"
...

我尝试点击日志中的那些链接,但大多数显示404错误代码。请帮忙。

英文:

I'm new to play framework. I'm trying to build an old project of my company (i'm a intern).
Here is the log

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.typesafe.play:play-java-2.12:2.6.6.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://jcenter.bintray.com/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://repo.lightbend.com/lightbend/maven-releases/com/typesafe/play/play-java-2.12/2.6.6/play-java-2.12-2.6.6.pom
       - https://repo.lightbend.com/lightbend/ivy-releases/com.typesafe.play/play-java-2.12/2.6.6/ivys/ivy.xml
     Required by:
         project :

My code in build.gradle (my company use gradle instead of sbt)

compile group: "com.typesafe.play", name: "play_$scalaVersion", version: "$playVersion"
compile group: "com.typesafe.play", name: "routes-compiler_$scalaVersion", version: "$playVersion"
...

I tried to click on those links in the logs but most of them show 404 error code. Please help.

答案1

得分: 1

看起来依赖项中有一个拼写错误。它的名称不是 play-java-2.12,而是 play-java_2.12(注意下划线)。你之前遇到 404 错误代码是因为该网址不存在,但将它更改为正确的网址后就可以正常访问:

https://repo.maven.apache.org/maven2/com/typesafe/play/play-java_2.12/2.6.6/

所以只需将依赖项的名称从 play-java-2.12 改为 play-java_2.12 即可。

英文:

There seems to be a typo for the dependency. It is not named play-java-2.12, but play-java_2.12 (notice the underscore). You are getting the 404 error code since the URL does not exist, but changing it to the correct URL works:

https://repo.maven.apache.org/maven2/com/typesafe/play/play-java_2.12/2.6.6/

So simply change the name of the dependency from play-java-2.12 to play-java_2.12 should do it.

huangapple
  • 本文由 发表于 2020年8月19日 16:03:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/63482560.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定