为Playframework构建文档

时间:2018-11-01 21:33:01

标签: build playframework sbt


试图在playframework的github页面上解决一个简单的问题,但为此,我必须构建文档。

根据他们的readme,我必须使用 sbt run这样做,但是最后(大约20分钟后),我得到一个错误:

[info] Packaging /home/ubuntu/playframework/framework/src/play-docs/target/scala-2.12/play-docs_2.12-2.7.0-SNAPSHOT.jar ...
[info] Done packaging.
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-docs_2.12;2.7.0-SNAPSHOT: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:320)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
    at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
    at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
    at sbt.IvySbt.withIvy(Ivy.scala:128)
    at sbt.IvySbt.withIvy(Ivy.scala:125)
    at sbt.IvySbt$Module.withModule(Ivy.scala:156)
    at sbt.IvyActions$.updateEither(IvyActions.scala:168)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1555)
    at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1551)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1586)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1584)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1589)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1583)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:1606)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1533)
    at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1485)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
[error] (Play-Documentation/*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play-docs_2.12;2.7.0-SNAPSHOT: not found
[error] Total time: 334 s, completed Nov 1, 2018 9:13:23 PM

所以我开始调查。我设置了一个新的Ubuntu Desktop 18.4副本,安装了Java 8,Sbt,将堆大小增加到2 GB,然后重试。不幸的是,结果相同。

为了完整起见,这是我的Java版本:

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

sbt run之后的前几行还建议由sbt导入的scala版本:

Getting org.scala-sbt sbt 0.13.17  (this may take some time)...

有人知道我的配置是否有问题(或者因为我已经在Windows 10 PC,Fedora 28和最新的Ubuntu 18.4上进行了测试而配置),或者我做错了什么?

1 个答案:

答案 0 :(得分:0)

说实话,我找到了答案。尚不清楚我是否需​​要在sbt publishLocal之前运行sbt run。有时我还有其他一些错误,例如“找不到X”,然后仅用以下命令构建软件包:

cd $PLAY_HOME/framework
sbt compile doc package

玩得开心!