首页 文章

在SBT项目中找不到lagom-javadsl-api

提问于
浏览
0

我是Lagom和SBT的新手,我正在尝试使用IntelliJ执行我的第一个项目 .

我的项目结构是:

enter image description here

我的SBT版本是:

sbt.version = 0.13.16

plugins.sbt文件包含:

// The Lagom plugin
addSbtPlugin("com.lightbend.lagom" % "lagom-sbt-plugin" % "1.3.10")
// Needed for importing the project into Eclipse
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0")

build.sbt文件包含:

name := "testsbt"

version := "1.0-SNAPSHOT"

scalaVersion := "2.12.3"

lazy val `hello-lagom` = (project in file("."))
  .aggregate(`user-api`, `user-impl`)

lazy val `user-api` = (project in file("user-api"))
  .settings(
    libraryDependencies += lagomJavadslApi
  )

lazy val `user-impl` = (project in file("user-impl"))
  .enablePlugins(LagomJava)
  .dependsOn(`user-api`)

问题是当我尝试构建项目时出现此错误:

sbt.ResolveException:未解析的依赖项:com.lightbend.lagom#lagom-javadsl-api_2.10; 1.3.10:not found [error](user-api / *:update)sbt.ResolveException:unresolved dependency:com.lightbend .lagom#lagom-javadsl-api_2.10; 1.3.10:未找到

我也有一些警告:

[info]完成更新 . [warn]在库依赖项中发现版本冲突;一些被怀疑是二进制不兼容:[warn] * org.jboss.logging:jboss-logging:3.3.0.Final被选中超过3.2.1.Final [warn] - com.lightbend.lagom:lagom-javadsl-api_2 .11:1.3.10(取决于3.2.1.Final)[warn] - org.hibernate:hibernate-validator:5.2.4.Final(取决于3.2.1.Final)[warn] * io.netty:netty -codec-http:4.0.51.Final被选中超过4.0.41.Final [warn] - com.lightbend.lagom:lagom-service-locator_2.11:1.3.10(取决于4.0.51.Final)[警告] ] - com.lightbend.lagom:lagom-client_2.11:1.3.10(取决于4.0.51.Final)[warn] - org.asynchttpclient:async-http-client:2.0.36(取决于4.0.51 . 最终)[警告] - com.typesafe.netty:netty-reactive-streams-http:1.0.8(取决于4.0.41.Final)

我可以't undresting why sbt can'找到 lagom-javadsl-api 依赖 . 我错过了什么 ?

谢谢你的帮助 .

1 回答

  • 1

    你需要设置:

    scalaVersion in ThisBuild := "2.11.12"
    

    这可确保为整个构建设置它,而不是仅为根项目设置 . 如果它只是为根项目设置,那么你得到默认的Scala版本,对于sbt 0.13是 2.10 . 此外,Lagom 1.3不是针对Scala 2.12交叉构建的,因此您必须使用2.11 .

相关问题