PR for #1589

Please review this PR for #1589.  As I have not been able to run SBT from my local build, I have not been able to test this PR. As mentioned in the notes for #1589, using the command there after "sbt package" does not run with the code changes that are apparently part of the build.

Happy to test this if someone can point me to some RTFM!
Minor style comment:  A helper method cleans this up a bit.

```scala
private[this] def mavenLocalDir: File = {
  def loadHomeFromSettings(f: File): Option[File] =
       (XML.loadFile(f) \ "settings" \ "localRepository")  match {
         case scala.xml.Text(loc) => Some(new File(loc))
         case _ => None
       }
  loadHomeFromSettings(new File(Path.userHome, ".m2/settings.xml")) orElse
  loadHomeFromSettings(new File(Path.fileProperty("M2_HOME"), "conf/settings.xml")) getOrElse
  new File(Path.userHome, ".m2/repository")
}
```