在 amazon aws 上使用 play framework 时 jnotify jar 依赖性问题
issue with jnotify jar dependency when using play framework on amazon aws
我在 ubuntu 14 (aws) 上安装了 play framework 2.4,但是每次我编译项目时,sbt 都无法提取 jnotify 依赖项。最后一个 *:update 命令显示如下:
sbt.ResolveException: download failed: net.contentobjects.jnotify#jnotify;0.94-play-1!jnotify.jar(src)
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:126)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:125)
at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
at sbt.IvySbt$$anonfun$withIvy.apply(Ivy.scala:103)
at sbt.IvySbt.sbt$IvySbt$$action(Ivy.scala:48)
at sbt.IvySbt$$anon.call(Ivy.scala:57)
at xsbt.boot.Locks$GlobalLock.withChannel(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:57)
at sbt.IvySbt.withIvy(Ivy.scala:98)
at sbt.IvySbt.withIvy(Ivy.scala:94)
at sbt.IvySbt$Module.withModule(Ivy.scala:115)
at sbt.IvyActions$.update(IvyActions.scala:125)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1223)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1221)
at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1244)
at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1242)
at sbt.Tracked$$anonfun$lastOutput.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1246)
at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1241)
at sbt.Tracked$$anonfun$inputChanged.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1249)
at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1214)
at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1192)
at scala.Function1$$anonfun$compose.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon.work(System.scala:64)
at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$$anonfun.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: download failed: net.contentobjects.jnotify#jnotify;0.94-play-1!jnotify.jar(src)
关于可能导致它的任何想法(包括我是否需要再次设置激活器)
我使用离线分发在服务器上下载播放框架。激活器已正确设置并具有正确的权限。
我最终从 https://maven.alfresco.com/nexus/content/repositories/thirdparty/net/contentobjects/jnotify/0.94/jnotify-0.94-sources.jar 手动下载,重命名了 jar 文件并将其放在我服务器的本地 ivy 存储库中。
下载并放入文件夹的解决方案仅适用于本地环境或任何持续集成服务器中的手动设置。这似乎是一个已知问题,已在 Play 2.3.2 中修复。这个question也说明了问题。我通过查看 sbt、scala 和 sbt-plugin 的版本设法解决了这个问题。我以以下配置结束:
build.properties
sbt.version=0.13.12
build.sbt
scalaVersion := "2.11.8"
plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.2")
我在 ubuntu 14 (aws) 上安装了 play framework 2.4,但是每次我编译项目时,sbt 都无法提取 jnotify 依赖项。最后一个 *:update 命令显示如下:
sbt.ResolveException: download failed: net.contentobjects.jnotify#jnotify;0.94-play-1!jnotify.jar(src)
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:217)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:126)
at sbt.IvyActions$$anonfun$update.apply(IvyActions.scala:125)
at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
at sbt.IvySbt$Module$$anonfun$withModule.apply(Ivy.scala:115)
at sbt.IvySbt$$anonfun$withIvy.apply(Ivy.scala:103)
at sbt.IvySbt.sbt$IvySbt$$action(Ivy.scala:48)
at sbt.IvySbt$$anon.call(Ivy.scala:57)
at xsbt.boot.Locks$GlobalLock.withChannel(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:57)
at sbt.IvySbt.withIvy(Ivy.scala:98)
at sbt.IvySbt.withIvy(Ivy.scala:94)
at sbt.IvySbt$Module.withModule(Ivy.scala:115)
at sbt.IvyActions$.update(IvyActions.scala:125)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1223)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work.apply(Defaults.scala:1221)
at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1244)
at sbt.Classpaths$$anonfun$doWork$$anonfun.apply(Defaults.scala:1242)
at sbt.Tracked$$anonfun$lastOutput.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1246)
at sbt.Classpaths$$anonfun$doWork.apply(Defaults.scala:1241)
at sbt.Tracked$$anonfun$inputChanged.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1249)
at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1214)
at sbt.Classpaths$$anonfun$updateTask.apply(Defaults.scala:1192)
at scala.Function1$$anonfun$compose.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon.work(System.scala:64)
at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$$anonfun$apply.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$$anonfun.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: download failed: net.contentobjects.jnotify#jnotify;0.94-play-1!jnotify.jar(src)
关于可能导致它的任何想法(包括我是否需要再次设置激活器)
我使用离线分发在服务器上下载播放框架。激活器已正确设置并具有正确的权限。
我最终从 https://maven.alfresco.com/nexus/content/repositories/thirdparty/net/contentobjects/jnotify/0.94/jnotify-0.94-sources.jar 手动下载,重命名了 jar 文件并将其放在我服务器的本地 ivy 存储库中。
下载并放入文件夹的解决方案仅适用于本地环境或任何持续集成服务器中的手动设置。这似乎是一个已知问题,已在 Play 2.3.2 中修复。这个question也说明了问题。我通过查看 sbt、scala 和 sbt-plugin 的版本设法解决了这个问题。我以以下配置结束:
build.properties
sbt.version=0.13.12
build.sbt
scalaVersion := "2.11.8"
plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.2")