Dump classpath used for sbt run?

1,342 views
Skip to first unread message

Sean Rhea

unread,
Mar 4, 2011, 11:59:32 AM3/4/11
to simple-b...@googlegroups.com
All,

In development I run my program like this:

sbt run "--foo bar"

and that works fine. But in production use, I want to pass particular
arguments to the JVM, and I don't need to load sbt. So I end up doing
something like

CLASSPATH=`find lib* -name '*.jar' | xargs echo | sed -e 's/
/:/g'`:project/boot/scala-2.8.1/lib/scala-library.jar:target/scala_2.8.1/classes
java -Xmx32M my.class.Name --foo bar

Is there a better way to do that? Something like

CLASSPATH=`sbt dump-classpath` java -Xmx32M my.class.Name --foo bar

Any pointers on how I might write one if not?

Thanks,
Sean
--
"I refuse to accept the idea that the ‘isness’ of man’s present nature
makes him morally incapable of reaching up for the eternal ‘oughtness’
that forever confronts him." --MLK

Hristo Deshev

unread,
Mar 4, 2011, 2:56:08 PM3/4/11
to simple-b...@googlegroups.com
Hi Sean,

On Fri, Mar 4, 2011 at 6:59 PM, Sean Rhea <sean....@gmail.com> wrote:
[snip]

Any pointers on how I might write one if not?

I was dumping my classpaths as a way to troubleshoot my build recently and maybe this task can help you too:

lazy val printClasspath = task { this.runClasspath.getPaths.foreach(println); None }

runClasspath is a PathFinder [1] instance and you can interrogate it even further. I guess building a ':'-separated list of those paths will be easy.

Hristo

Sean Rhea

unread,
Mar 5, 2011, 6:58:39 PM3/5/11
to simple-b...@googlegroups.com, Hristo Deshev
Perfect, thanks!

Sean

> --
> You received this message because you are subscribed to the Google Groups
> "simple-build-tool" group.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to
> simple-build-t...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/simple-build-tool?hl=en.

Reply all
Reply to author
Forward
0 new messages