java_binary()rule is used to create a JAR file of the compiled .class files and resources of the
java_library()rules on which it depends.
The name of the rule, as well as the name of the generated JAR file.
Rules (normally of type
java_library) that should be compiled and whose
.classfiles and resources should be included in the generated JAR file.
If provided, this will be the value specified as the
Main-Classattribute of the
META-INF/MANIFEST.MFfile in the generated JAR file. Also, when this rule is used as an executable in a
main_classwill indicate the class whose
main()method will be invoked to process the command-line arguments. This is consistent with the expected usage of
java -jar<name.jar> <args>.
If provided, this manifest will be used when generating the JAR file. If combined with
main_class, the specified manifest file will be used but the
main_classwill override the main class in the manifest.
Note: This has beta support currently. If provided, the contents in this directory will end up in the
META-INFdirectory inside the generated JAR file.
A list of patterns that identify files to exclude from the final generated JAR file. Example:
java_binary( name = 'example', blacklist = [ # Excludes com.example.A and com.example.Alligator, # as well as their inner classes and any non-class files that happen to match # the pattern 'com.example.A', # Excludes all files from org/slf4j/**/*. 'org.slf4j', ], deps = [ ':example1', ':third-party-stuff', ], )
List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their
exported_depsattributes. For more information, see Visibility.