在Play 2.2.1项目中使用hibernate-entitymanager 4.3.0.Final?

时间:2014-01-10 12:42:35

标签: java hibernate playframework playframework-2.0 sbt

我正在尝试使用Hibernate和JPA设置项目。

这是build.sbt

name := "todolist"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "org.hibernate" %% "hibernate-entitymanager" % "4.3.0.Final"
)

resolvers += "JBoss Repository" at "https://repository.jboss.org/nexus/content/repositories/releases/"

play.Project.playJavaSettings

我添加了JBoss Repository,因此可以找到相关的jar。但它也没有帮助。

这是我从play run

获得的输出
[info] Resolving org.hibernate#hibernate-entitymanager_2.10;4.3.0.Final ...
[warn]  module not found: org.hibernate#hibernate-entitymanager_2.10;4.3.0.Final
[warn] ==== local: tried
[warn]   /home/benny/Development/JavaLibraries/play-2.2.1/repository/local/org.hibernate/hibernate-entitymanager_2.10/4.3.0.Final/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn]   file:/home/benny/.m2/repository/org/hibernate/hibernate-entitymanager_2.10/4.3.0.Final/hibernate-entitymanager_2.10-4.3.0.Final.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/hibernate/hibernate-entitymanager_2.10/4.3.0.Final/hibernate-entitymanager_2.10-4.3.0.Final.pom
[warn] ==== JBoss Repository: tried
[warn]   https://repository.jboss.org/nexus/content/repositories/releases/org/hibernate/hibernate-entitymanager_2.10/4.3.0.Final/hibernate-entitymanager_2.10-4.3.0.Final.pom
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/hibernate/hibernate-entitymanager_2.10/4.3.0.Final/hibernate-entitymanager_2.10-4.3.0.Final.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.hibernate#hibernate-entitymanager_2.10;4.3.0.Final: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.hibernate#hibernate-entitymanager_2.10;4.3.0.Final: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:213)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:116)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:104)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:51)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:60)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
    at xsbt.boot.Using$.withResource(Using.scala:11)
    at xsbt.boot.Using$.apply(Using.scala:10)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:60)
    at sbt.IvySbt.withIvy(Ivy.scala:101)
    at sbt.IvySbt.withIvy(Ivy.scala:97)
    at sbt.IvySbt$Module.withModule(Ivy.scala:116)
    at sbt.IvyActions$.update(IvyActions.scala:121)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1144)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1142)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$73.apply(Defaults.scala:1165)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$73.apply(Defaults.scala:1163)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1167)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1162)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1170)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1135)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1113)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.hibernate#hibernate-entitymanager_2.10;4.3.0.Final: not found

它搜索JBoss Repository,但似乎在寻找hibernate-entitymanager_2.10?这是为什么? <{1}}后缀未在任何地方指定。

1 个答案:

答案 0 :(得分:1)

好的,我刚刚发现当你使用%%时,它会将scala版本添加到工件ID中。 通过将其更改为

来修复
libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "org.hibernate" % "hibernate-entitymanager" % "4.3.0.Final"
)