Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make classpath configurable #47

Open
tgpfeiffer opened this issue Dec 2, 2014 · 3 comments
Open

Make classpath configurable #47

tgpfeiffer opened this issue Dec 2, 2014 · 3 comments

Comments

@tgpfeiffer
Copy link

In my setup, some dependencies are marked as "provided" because they are actually provided by the environment at runtime (Spark/Hadoop) and they should not go into the application jar as build by sbt assembly. To have them in the classpath when using sbt run, I can use the trick from http://stackoverflow.com/a/21803413/3663881. To achieve the same when running with the script generated by sbt start-script, there seems to be no such easy solution.

Actually,

SbtStartScript.StartScriptKeys.relativeFullClasspathString in Compile <<=
  (SbtStartScript.StartScriptKeys.startScriptBaseDirectory, fullClasspath in Compile) map relativeClasspathStringTask

would do the trick quite well, but as relativeClasspathStringTask() is private, I had to create a verbatim copy of relativeClasspathStringTask(), relativizeFile(), and directoryEqualsOrContains(). That is quite "not so good" and it would be nice to have a possibility to configure which classpath is used.

@havocp
Copy link
Contributor

havocp commented Dec 2, 2014

This plugin hasn't seen much maintenance since most people have switched to sbt-native-packager - have you tried that out?

@tgpfeiffer
Copy link
Author

No, actually I haven't. This plugin seemed much simpler to get me started, as I only want a faster version of "sbt run".

@havocp
Copy link
Contributor

havocp commented Dec 8, 2014

This one is simpler, but also has far fewer features. Instructions to convert are in the README https://github.com/sbt/sbt-start-script/blob/master/README.md though I haven't updated them in a long time, so it's possible they are slightly stale. I don't know if sbt-native-packager makes this task easier but you would likely get an answer on stackoverflow if you ask.
Another option could be to drop https://github.com/sbt/sbt-start-script/blob/master/src/main/scala/com/typesafe/sbt/SbtStartScript.scala into your project/ directory and edit it a bit to do what you want...
or take this plugin and run with maintaining it, but that's a pretty big yak shave for a simple problem :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants