2

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)

biesior
  • 55,576
  • 10
  • 125
  • 182
gdiamantidis
  • 102
  • 3
  • 10

2 Answers2

2

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.

Yuri
  • 185
  • 1
  • 13
1

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.

i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
  • thank you. I added into Build.scala: `artifact in (Compile, oneJar) ~= { art => art.copy(\`classifier\` = Some("one-jar")) } addArtifact(artifact in (Compile, oneJar), oneJar)`. But that didn't work. I placed it outside `play.Project(...).settings(...)`.Is that correct? Sorry, I am completely new to sbt – gdiamantidis Jul 12 '13 at 15:08