Create a single executable file from project

212 views
Skip to first unread message

Tsume

unread,
Aug 25, 2013, 7:53:19 PM8/25/13
to simple-b...@googlegroups.com
Hi,

Which SBT plugin should I use to create a single executable (or jar) file from a scala project?
The plugin  should incorporate my dependencies and the jar files in my library.
I found OneJar but there hasn't been an update in awhile.

Thanks in advance.

Doug Tangren

unread,
Aug 25, 2013, 7:58:21 PM8/25/13
to simple-b...@googlegroups.com

Use sbt assembly

https://github.com/sbt/sbt-assembly

Its been one of the most dependable and well maintained plugins I've used.

>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
> To post to this group, send email to simple-b...@googlegroups.com.
> Visit this group at http://groups.google.com/group/simple-build-tool.
> For more options, visit https://groups.google.com/groups/opt_out.

Tsume

unread,
Aug 26, 2013, 6:20:54 PM8/26/13
to simple-b...@googlegroups.com
Thanks softprops, it seems to be what I'm looking for. Unfortunately I'm getting an error when  I try to assemble the jar

[error] (*:assembly) scala.MatchError: akka/io/BackpressureBuffer$$anon$11$$anonfun$18.class (of class java.lang.String)


My build.sbt has the following in for the Merge Strategy

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
  {
    case "JsonWriteNullProperties.class" => MergeStrategy.last
  }
}

No where in the document does it talk about encountering MatchError's

Paolo Giarrusso

unread,
Aug 27, 2013, 3:47:48 PM8/27/13
to simple-b...@googlegroups.com


On Tuesday, August 27, 2013 12:20:54 AM UTC+2, Tsume wrote:
Thanks softprops, it seems to be what I'm looking for. Unfortunately I'm getting an error when  I try to assemble the jar

[error] (*:assembly) scala.MatchError: akka/io/BackpressureBuffer$$anon$11$$anonfun$18.class (of class java.lang.String)


My build.sbt has the following in for the Merge Strategy

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
  {
    case "JsonWriteNullProperties.class" => MergeStrategy.last
  }
}

Your pattern match does not have a default case.
 
No where in the document does it talk about encountering MatchError's
 
MatchError is not sbt-assembly specific, so it shouldn't be documented there. That error is just telling you that old != "JsonWriteNullProperties.class", so the match failed. Please google MatchError for details.
In particular, the error even mentions the value of old, that is "akka/io/BackpressureBuffer$$anon$11$$anonfun$18.class".
Reply all
Reply to author
Forward
0 new messages