How to publish additional artifact with sbt (one-jar)

穿精又带淫゛_ 提交于 2019-12-12 20:55:28

问题


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?

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.

(play 2.1.2, sbt 0.12.3, scala 2.10)


回答1:


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)

and then

sbt publish

Published the jar to Artifactory.




回答2:


I have no experience with one-jar but here is an alternative : give sbt-assembly a try. Same principle but with an existing option to publish the jar.



来源:https://stackoverflow.com/questions/17616425/how-to-publish-additional-artifact-with-sbt-one-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!