问题
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