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

Add all jars in lib directory to classpath #885

Closed
rogue-one opened this issue Oct 5, 2016 · 1 comment
Closed

Add all jars in lib directory to classpath #885

rogue-one opened this issue Oct 5, 2016 · 1 comment
Labels
feature request universal Zip, tar.gz, tgz and bash issues
Projects

Comments

@rogue-one
Copy link

consider the below scenario,

A application that is distributed as a zip archive to end users has few provided dependencies. The end users are expected to provided these provided dependencies by dropping in all the provided dependencies jars in lib directory. It seems currently any new jars added to the lib directory is not automatically added to the classpath.

so basically we need a setting/flag in native packager to add all jars in the lib directory to the application classpath. so the following change should take place in the start-up script.

from:

java -cp /var/path/lib/libary1.jar:/var/path/lib/library2.jar... com.example.Main

to:

java -cp "/var/path/lib/*" com.example.Main

@muuki88 muuki88 added feature request universal Zip, tar.gz, tgz and bash issues labels Oct 6, 2016
@muuki88
Copy link
Contributor

muuki88 commented Oct 6, 2016

Hi,

Thanks for your detailed description. Native-packager already as support for wildcard classpath. You can achieve this by setting

scriptClasspath := Seq("*")

However we won't make this the default behaviour for a couple of reasons

  • security. The application only adds things to the classpath it knows about.
  • predictability. Your application will start with the same classpath order each time.

@muuki88 muuki88 closed this as completed Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request universal Zip, tar.gz, tgz and bash issues
Projects
Development

No branches or pull requests

2 participants