Specify a File Bundle
Problem
You have created a jvm_app target definition for bundling a Scala or Java project and you want to include assets such as config files or shell scripts in the bundle.
Solution
Add a bundles list to your jvm_app target definition (more info on jvm_app definitions can be found in Define a Scala or Java Bundle Target).
Discussion
Here is an example jvm_app definition that shows different possibilities for defining file bundles (and explains them below):
jvm_app( name='bundle', bundle(fileset=['src/main/resources/**/*')), # 1 bundle(fileset=['config/*', '!*.xml']), # 2 bundle(fileset=['src/scripts/*.sh'], relative_to='src') # 3 )
- All files in the
src/main/resourcesdirectory are recursively included. - All files in the
configdirectory are included, except any.xmlfiles. - All
.shfiles in thesrc/scriptsdirectory will be included. Therelative_toeffectively strips away the specified directory, in this casesrc, which means that all files insrc/scriptswould end up in the root of the bundle. If you specifiedrelative_to='src/scripts'instead, for example, all files would end up in the root directory.
See Also
Generated by publish_docs
from dist/markdown/html/src/docs/common_tasks/file_bundles.html 2022-12-03T01:08:59.482079