0
votes

I am trying to publish my SBT project to mvnrepository. I am following the directions at these links:

http://www.scala-sbt.org/release/docs/Using-Sonatype.html, and https://github.com/xerial/sbt-pack

When I add the xerial sbt-sonatype plugin to my build.sbt file:

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")   

The compiler gives me the following error:

UNRESOLVED DEPENDENCIES

org.xerial.sbt#sbt-sonatype;1.1 not found

Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13) (/richstat/build.sbt#L56-57)
[warn]        +- com.github.shafiquejamal:richstat_2.11:0.0.1

My SBT version is 0.13, and I am using Scala 2.11. How can I fix this? Thanks!

1

1 Answers

1
votes

You have to add plugins in project/plugins.sbt, because plugins are dependencies of the meta-project, not your library/application.

Check sbt documentation: Using Plugins.

Also regarding sbt version and Scala version: there is Scala version used to compile your project's code (2.11 in your case), and there is Scala version used by sbt itself. The latter is determined by the sbt version: sbt-0.13 uses Scala 2.10, sbt-1.0 uses Scala 2.12.

P.S. I recommend you updating to sbt-1.0.2: just change the version in project/build.properties and use sbt-sonatype 2.0.