尝试通过sbt "++2.11.6 publishLocal"
或sbt +publishLocal
为我的项目发布jar时,在发布Scala 2.11.6时会遇到Scaladoc问题。我似乎有@throws
标记导致的无效链接。我不知道为什么我有无效链接,也不知道为什么在我的交叉发布期间Scala 2.11.6只出现错误,而Scala 2.10.5则出错。我无法找到任何迹象表明Scala 2.11上不支持@throws
标记;所以,我认为这是我的Scaladoc的一个问题,但我不知道我在这一点上缺少什么。谁能让我对这个问题有所了解?
/**
* Attempts to load the JDI, asserting that it can be and is loaded.
*
* @throws AssertionError If failed to load the JDI
*/
@throws(classOf[AssertionError])
protected def assertJdiLoaded(): Unit =
assert(jdiLoader.tryLoadJdi(),
"""
|Unable to load Java Debugger Interface! This is part of tools.jar
|provided by OpenJDK/Oracle JDK and is the core of the debugger! Please
|make sure that JAVA_HOME has been set and that tools.jar is available
|on the classpath!
""".stripMargin.replace("\n", " "))
上面的代码段(报告的问题之一)是我项目中文件的一部分:https://github.com/rcsenkbeil/scala-debugger/blob/master/scala-debugger-api/src/main/scala/org/senkbeil/debugger/Debugger.scala#L22
Scaladoc编译错误的实际系列如下:
[info] Loading project definition from /home/senkwich/projects/scala-debugger/project
[info] Set current project to scala-debugger (in build file:/home/senkwich/projects/scala-debugger/)
[info] Setting version to 2.11.6
[info] Reapplying settings...
[info] Set current project to scala-debugger (in build file:/home/senkwich/projects/scala-debugger/)
[info] Wrote /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/scala-debugger-api_2.11-1.0.0.pom
[info] :: delivering :: org.senkbeil#scala-debugger-api_2.11;1.0.0 :: 1.0.0 :: release :: Sat Jul 18 00:59:01 CDT 2015
[info] delivering ivy file to /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/ivy-1.0.0.xml
[info] Main Scala API documentation to /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/api...
model contains 35 documentable templates
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:170: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:192: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:158: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:138: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:126: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:106: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:94: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:73: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:112: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:87: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:54: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:33: Could not find any member to link for "Throwable".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/jdi/JDILoader.scala:206: Could not find any member to link for "ClassNotFoundException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:138: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:156: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:110: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:92: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:72: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/Debugger.scala:19: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] 19 errors found
[error] (scalaDebuggerApi/compile:doc) Scaladoc generation failed
[error] Total time: 17 s, completed Jul 18, 2015 12:59:17 AM
答案 0 :(得分:16)
根据讨论here,我决定通过添加Scaladoc选项-no-link-warnings
来暂时解决错误。
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links
)
答案 1 :(得分:2)
请注意,如果您根本不需要scaladoc-s,可以将它们清空:
sources in (Compile,doc) := Seq.empty
根本不发布:
publishArtifact in packageDoc := false