How to add native library dependencies to sbt project?

sbt, scala

Solution

You should replace the `%%` (double percent) with single one.

libraryDependencies += "org.apache.pdfbox" % "pdfbox" % "1.8.2"

The double-percent is a convenience operator, and causes adding the `_`+`scalaVersion` postfix inside the path, which is `_2.10` in your case. Single percent should fix the problem.

Problem

I want to add a Java library (e.g. Apache PDFBox) to an `sbt` project. This is the Ivy dependency: ``` dependency org="org.apache.pdfbox" name="pdfbox" rev="1.8.2" ``` I first tried to do the following: ``` resolvers += "Sonatype releases" at "http://oss.sonatype.org/content/repositories/releases/" libraryDependencies += "org.apache.pdfbox" %% "pdfbox" % "1.8.2" ``` But it gives me errors of the type ``` [warn] ==== public: tried [warn] http://repo1.maven.org/maven2/org/apache/pdfbox/pdfbox_2.10/1.8.2/pdfbox_2.10-1.8.2.pom ``` So I understand that with this syntax I can just manage Scala dependencies. I am sure that there is a way to manage Java dependencies, but how? I tried to search in Google for "sbt add java dependencies" but did not find (recognize) a relevant result.

Original source