Question

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)

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top