将 sbt 工件发布到文件系统 [英] Publish sbt artifact to filesystem

查看:45
本文介绍了将 sbt 工件发布到文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个位于 file:///some/path/here 的内部 Maven 存储库.我想将我的 sbt 工件发布到这个位置.我收集到以下内容应该有效.

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)

如何使用 sbt 将工件发布到文件路径指定的存储库?

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

推荐答案

使用这种格式发布到本地文件路径:

Use this format to publish to a local file path:

publishTo := Some(Resolver.file("file", new File("/some/path/here"))) 

这篇关于将 sbt 工件发布到文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆