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

Usage of JavaAppPackaging scriptClasspath #793

Closed
luigiberrettini opened this issue May 14, 2016 · 6 comments
Closed

Usage of JavaAppPackaging scriptClasspath #793

luigiberrettini opened this issue May 14, 2016 · 6 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@luigiberrettini
Copy link

I do not want to use a wildcard classpath to avoid having a different ordering from the one used by sbt and I saw that you defined scriptClasspath as "A list of relative filenames (to the lib/ folder in the distribution) of what to include on the classpath."

  1. If I don't override it is there a default value used to create the launcher / classpath jar?
  2. If not, what is the right way to override it preserving sbt ordering and specifying filenames with a path relative to the lib folder?
  3. Are only files in lib allowed or also files in other folders (provided I can get their path as a relative path to the lib folder)?

Thank you!
Luigi.

@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label May 14, 2016
@muuki88
Copy link
Contributor

muuki88 commented May 15, 2016

Thanks for your questions @luigiberrettini . What is the issue you are facing and which problem are you trying to solve?

If I don't override it is there a default value used to create the launcher / classpath jar?

Yes. If you take a look at the generated start scripts (bash/bat), you will see that every dependency is listed explicitly. You don't have to configure anything if you use the JavaAppPackaging archetype. The LauncherJarPlugin and ClasspathJarPlugin just alter the start command to avoid long classpath problems

If not, what is the right way to override it preserving sbt ordering and specifying filenames with a path relative to the lib folder?

You can just append/prepend stuff the scriptClasspath if needed.

Are only files in lib allowed or also files in other folders (provided I can get their path as a relative path to the lib folder)?

You can add anything you want to the classpath as long it's accessible on your target system.

@luigiberrettini
Copy link
Author

luigiberrettini commented May 17, 2016

Thank you!
I managed to create the launcher JAR and the manifest contains the full classpath without me writing anything.

I also managed to alter mappings so that the launcher JAR is moved to the folder containing lib and conf folders and I modified classpath to add "lib/" in front of each entry:
scriptClasspath in packageJavaLauncherJar := (scriptClasspath in packageJavaLauncherJar).value map { item => "lib/" + item }

@muuki88
Copy link
Contributor

muuki88 commented May 17, 2016

This is strange. Acutally by using

enablePlugins(ClasspathJarPlugin)

everything should just work.

@luigiberrettini
Copy link
Author

Indeed, but I wanted to change the behavior: instead that all JARs (included the launcher) inside the lib folder I wanted to have the launcher in the folder containing the lib one and all other JARs in the lib folder.

@muuki88
Copy link
Contributor

muuki88 commented May 18, 2016

Ah. Now I get it. Is there any particular reason for this?

@luigiberrettini
Copy link
Author

Just to separate the launcher: in this way I can also guarantee the "without launcher JAR" behavior using a * classpath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants