package breeze as a jar

422 views
Skip to first unread message

Daniel Agota

unread,
Aug 18, 2012, 6:27:50 PM8/18/12
to scal...@googlegroups.com

Hi,

I'm relatively new to both scala and breeze and wondered wether there is an easy way to include breeze
as an external jar in my eclipse project.

I have downloaded breeze (the zip), unpacked it and ran sbt with publish-local.
ran package too after it.

Now I'm stuck and sbt's walk through has not helped me either.

On my Linux under my user directory I have found the
.ivy2/local/default/default-f8dd8f_2.9.2/0.1-SNAPSHOT/jars
directory with some poms and other stuff, jars named default-f8dd8f_2.9.2.jar but that doeson't look like something I could include in my project...

I'm just looking for a good old jar ready to be added to my projects build path...without poms, maven deps, ivy etc.

Any advice or suggestion?

Thank you,
Daniel


 




David Hall

unread,
Aug 18, 2012, 7:43:48 PM8/18/12
to scal...@googlegroups.com
You have two easy options.

Use sbteclipse: https://github.com/typesafehub/sbteclipse

OR

run sbt assembly

which will make a big jar in
learn/target/breeze/breeze-learn-0.1-SNAPSHOT-assembly.jar

that has all dependencies inside it.
> --
> You received this message because you are subscribed to the Google Groups
> "ScalaNLP" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/scalanlp/-/yz8kD5IVkroJ.
> To post to this group, send email to scal...@googlegroups.com.
> To unsubscribe from this group, send email to
> scalanlp+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/scalanlp?hl=en.

Daniel Agota

unread,
Aug 18, 2012, 8:35:51 PM8/18/12
to scal...@googlegroups.com
Hi David,

thanks for the quick answer.

I have updated my plugins.sbt file according to the sbt-assembly getting started instructions, now it looks like:

resolvers += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.7.2")

libraryDependencies ++= Seq(
  "org.jacoco" % "org.jacoco.core" % "0.5.6.201201232323" artifacts(Artifact("org.jacoco.core", "jar", "jar")),
  "org.jacoco" % "org.jacoco.report" % "0.5.6.201201232323" artifacts(Artifact("org.jacoco.report", "jar", "jar")))

addSbtPlugin("de.johoop" % "jacoco4sbt" % "1.2.2")

scalacOptions in Global += "-deprecation"

I have created a build.sbt in the project root directory (besides the sbt script ) with:

import AssemblyKeys._

jarName in assembly := "breeze.jar"

name := "breeze"

version := "1.0"

If I run assembly in the sbt command line I get an error stating:

[error] Not a valid command: assembly
[error] Not a valid project ID: assembly
[error] Not a valid configuration: assembly
[error] Not a valid key: assembly
[error] assembly
[error]         ^

Any hints maybe?

D

David Hall

unread,
Aug 18, 2012, 8:47:28 PM8/18/12
to scal...@googlegroups.com
You have to make the assembly in breeze itself. It ships with the sbt
assembly plugin, so all you have to do is run sbt assembly in Breeze?

-- David

Daniel Agota

unread,
Aug 19, 2012, 5:47:50 AM8/19/12
to scal...@googlegroups.com


After some debugging I realized that the sbt pacman package I installed preaviously somehow interferred with the one packeged with breeze. After deleting it and starting the project new from download/unzip:

1 download and extract breeze zip
2 run ./sbt from command line
3 run assembly as an sbt command

your advice worked like charm.
Thank you, D

David Hall

unread,
Aug 19, 2012, 2:16:30 PM8/19/12
to scal...@googlegroups.com

Great!

Reply all
Reply to author
Forward
0 new messages