Define a JVM Executable
Problem
You need to specify a Scala or Java binary target that you can compile and/or run directly.
If you need to specify a Scala or Java library target, see Create a New Scala or Java Library Target.
Solution
Create a jvm_binary
target definition for your project that specifies which scala_library
or java_library
target will be included in the binary (you can also include several).
Discussion
In any jvm_binary
target you must specify the following:
- A
name
for the target - A
basename
that will be used as the basis of the filename if you bundle the target using ajvm_app
target - The
main
function which serves as the executable's entry point. - A list of
dependencies
that must include at least onescala_library
orjava_library
target. More info can be found in Add a Dependency from Source. - A list of file
bundles
for use as static assets (optional). More info can be found in Specify a File Bundle.
Here's an example jvm_binary
definition:
jvm_binary(name='bin', basename='myproject-bin', main='com.acme.myproject.Main', dependencies=[ 'server-lib/src/main/java', 'analytics-lib/src/main/java', ], bundles=[ bundle(fileset=globs('assets/*')) ] )
See Also
Generated by publish_docs
from dist/markdown/html/src/docs/common_tasks/jvm_binary.html 2018-05-03T17:02:31.274707