sbt/sbt — pull request #1579 by copumpkin (2014-09-07 00:10:29+00:00)
Title: Support publishing to repositories specified in ~/.sbt/repositories. Fixes #1570

This simply looks at the protocol specified in the `repositories` file and if it's a `file` URL, it makes a `FileSystemResolver`. There's some minor trickery involved in converting URLs to `File` objects when Windows UNC paths are involved. Once we get to assume Java 7, the `Paths` module should deal with that for us, but for now it seems like we still support 6.

I've tested this manually on Mac OS, but don't have a handy Windows machine or VM to test the UNC path stuff on right now.

How to test it
==========

Scripting a test case was beyond me, but this is what I did. First create a `~/.sbt/repositories` file containing something like the following (edit path, obviously):

```
[repositories]
local
foo: file:///Users/copumpkin/Sandbox/ivy-test/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
```

Then take an sbt project and change its `publishTo` to use your repository:

```scala
publishTo := (appResolvers in LocalRootProject).value.toSeq.flatten.find(_.name == "foo")
```

and attempt to publish. Without this change, it will fail saying things like:

```
[error] (core/*:publish) java.lang.UnsupportedOperationException: URL repository only support HTTP PUT at the moment
```