sbt test:doc Could not find any member to link

sbt, scala, scaladoc

Solution

Not sure if this is a satisfactory solution, but...

Scaladoc currently expects pairs of jar and URL to get the external linking to work. You can force sbt to link internal dependencies using JARs using `exportJars`. Compare the value of

$ show test:fullClasspath

before and after setting `exportJars`. Next, grab the name of the JAR that's being used and link it to the URL you'll be uploading it to.

scalaVersion := "2.11.0"

autoAPIMappings := true

exportJars := true

scalacOptions in (Test, doc) ++= Opts.doc.externalAPI((
  file(s"${(packageBin in Compile).value}") -> url("http://example.com/")) :: Nil)

Now I see that `test:doc` a Scaladoc with links to http://example.com/index.html#foo.IntExtractor from my `foo.IntExtractor`.

Problem

I'm attempting to run `sbt test:doc` and I'm seeing a number of warnings similar to below: [warn] /Users/tleese/code/my/stuff/src/test/scala/com/my/stuff/common/tests/util/NumberExtractorsSpecs.scala:9: Could not find any member to link for "com.my.stuff.common.util.IntExtractor". The problem appears to be that Scaladoc references from test sources to main sources are not able to link correctly. Any idea what I might be doing wrong or need to configure? Below are the relevant sections of my Build.scala: ``` val docScalacOptions = Seq("-groups", "-implicits", "-external-urls:[urls]") scalacOptions in (Compile, doc) ++= docScalacOptions scalacOptions in (Test, doc) ++= docScalacOptions autoAPIMappings := true ```

Original source

Related problems