3

I have an internal maven repository located at file:///some/path/here. I would like to publish my sbt artifacts to this location. I gleaned that the following should work.

publishMavenStyle := true

publishTo <<= version { (v: String) =>
  val path = "file:///some/path/here/"
  if (v.trim.endsWith("SNAPSHOT"))
    Some("snapshots" at nexus + "maven-snapshots")
  else
    Some("releases"  at nexus + "maven")
}

However, this fails with the following exception.

[info]  delivering ivy file to .../target/scala-2.9.2/ivy-1.0-SNAPSHOT.xml
java.lang.UnsupportedOperationException: URL repository only support HTTP PUT at the moment
    at org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:202)
    at org.apache.ivy.util.FileUtil.copy(FileUtil.java:150)
    at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:84)

How can I publish artifacts using sbt to a repository specified by a file path?

schmmd
  • 18,650
  • 16
  • 58
  • 102
  • Here is a related problem with no solution: https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/m1ogeyCPinQ – schmmd Feb 13 '13 at 17:04

1 Answers1

3

Use this format to publish to a local file path:

publishTo := Some(Resolver.file("file", new File("/some/path/here"))) 
rancidfishbreath
  • 3,944
  • 2
  • 30
  • 44