本文介绍了如何使用sbt(one-jar)发布其他工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是scala和sbt的新手.我设法用一个罐子插件创建了一个可执行罐子.

I am new to scala and sbt. I managed to create an executable jar with one-jar plugin.

我正在尝试将这个额外的(单一罐)工件发布到工件上,但是我无法做到这一点.有人知道怎么做吗?

I am trying to publish this additional (one-jar) artifact to artifactory, but I am not able to do that. Does anybody know how to do that?

我查看了 http://www .scala-sbt.org/0.12.3/docs/Detailed-Topics/Artifacts.html ,但我无法使其正常工作.

I had a look at http://www.scala-sbt.org/0.12.3/docs/Detailed-Topics/Artifacts.html but I was not able to get it to work.

(播放2.1.2,sbt 0.12.3,scala 2.10)

(play 2.1.2, sbt 0.12.3, scala 2.10)

推荐答案

我在build.sbt中添加了以下内容,并且运行良好.

I added the following to build.sbt and it worked fine.

com.github.retronym.SbtOneJar.oneJarSettings
artifact in (Compile, oneJar) ~= { art =>
art.copy(`classifier` = Some("one-jar"))
}

addArtifact(artifact in (Compile, oneJar), oneJar)

然后

sbt publish

将罐子发布到Artifactory.

Published the jar to Artifactory.

这篇关于如何使用sbt(one-jar)发布其他工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 07:27