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

Ability to add to class path in the bash script #124

Closed
hadesara opened this issue Jan 8, 2014 · 11 comments
Closed

Ability to add to class path in the bash script #124

hadesara opened this issue Jan 8, 2014 · 11 comments

Comments

@hadesara
Copy link

hadesara commented Jan 8, 2014

After Play dist
If we are calling the bash/bat script thats under bin from other build script, there has to be a way to add jars to the classpath. -J-X option allows us to pass additional parameters but its not usable to add to existing classpath.

@mariussoutier
Copy link

👍 Would like this as well to reduce the size of the dist file by excluding JARs that are present on the server anyway.

@muuki88
Copy link
Contributor

muuki88 commented Aug 11, 2014

I think this is related to #72 The same concerns remain

  • classpath ordering
  • security

@mariussoutier
Copy link

I'm not asking for a wildcard, so classpath ordering would not be an issue. Just the ability to add a JAR to the classpath that is not inside the lib folder (for that you can simply add to scriptClasspath).

What are the security concerns?

@kardapoltsev
Copy link
Member

I'm also looking for some way to decrease package size, it would be great to handle dependencies some way but I don't know good way for this :(

@muuki88
Copy link
Contributor

muuki88 commented Aug 12, 2014

Hm. What about the possibility to symlink dependencies. Like

providedDependenciesMapping ++= Seq(
   "com.example" % "commons" % "1.0" -> "/usr/share/java/com.example.commons-1.0.jar"
)

This is very rough idea, but you get the gist. I'm not sure if this would get too tedious
keeping track of the dependencies. However with this technique you wouldn't have to
touch the classpath stuff.

@mariussoutier
Copy link

Yeah I guess it can get hairy pretty fast...

@kardapoltsev
Copy link
Member

LGTM :) I think I could try to implement this.

@kardapoltsev
Copy link
Member

I'm not sure if this would get too tedious keeping track of the dependencies.

It would)

@kardapoltsev
Copy link
Member

I think it will much simpler and robust way is to provide exact jars (biggest in my case), since manual dependency management will be really tedious. What do you think about?

providedDependenciesMapping ++= Seq(
  "com.example.commons-1.0.jar" -> "/usr/share/java/com.example.commons-1.0.jar"
)

But if anyone has better idea it'll be super)

@muuki88
Copy link
Contributor

muuki88 commented Aug 12, 2014

Sure, sure. I proposed the one with the artifact identifier, so you may be able to pick it out
from the raw dependencies. Anyway, I'm looking forward to see a prototype :)

@muuki88
Copy link
Contributor

muuki88 commented Sep 25, 2014

An update on this. There is a setting scriptClasspath

TaskKey[Seq[String]]("scriptClasspath",
 """
 A list of relative filenames (to the lib/ folder in the distribution) 
 of what to include on the classpath.
 """
)

You may override this at your own risk. I'm using this for the fat-jar creating with sbt-assembly

@muuki88 muuki88 closed this as completed Nov 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants