BUILD.bazel in the package of java code. As the code shows it should package the contents of dist out_dirs.
java_binary(
name = "app_lib",
main_class = "codes.showme.server.Main",
create_executable = False,
resources = [
# I am going to include the react ui dist conent into my java project's resource folder while building
"//web-react-ui:build",
],
runtime_deps = [
":lib",
],
)
But when I unpackage the java jar, the dist folder is empty.
Is there any way to package all contents into the jar file? Thank you.
Version
Development (host) and target OS/architectures:
Output of bazel --version: 7.2.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc4")
bazel_dep(name = "aspect_rules_jest", version = "0.22.0-rc0")
bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc1")
bazel_dep(name = "aspect_rules_swc", version = "2.0.0-rc0")
bazel_dep(name = "aspect_rules_ts", version = "3.0.0-rc0")
bazel_dep(name = "aspect_rules_rollup", version = "2.0.0-rc0")
bazel_dep(name = "aspect_rules_webpack", version = "0.16.0-rc0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_nodejs", version = "6.1.1")
What happened?
I have a bazel project that include java code and react code.
I am going to include the react ui build result into my java project's resource folder while building.
BUILD.bazel in the package of react code
BUILD.bazel in the package of java code. As the code shows it should package the contents of dist out_dirs.
But when I unpackage the java jar, the dist folder is empty.
Is there any way to package all contents into the jar file? Thank you.
Version
Development (host) and target OS/architectures:
Output of
bazel --version
: 7.2.1Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:bazel_dep(name = "aspect_bazel_lib", version = "2.7.7") bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc4") bazel_dep(name = "aspect_rules_jest", version = "0.22.0-rc0") bazel_dep(name = "aspect_rules_js", version = "2.0.0-rc1") bazel_dep(name = "aspect_rules_swc", version = "2.0.0-rc0") bazel_dep(name = "aspect_rules_ts", version = "3.0.0-rc0") bazel_dep(name = "aspect_rules_rollup", version = "2.0.0-rc0") bazel_dep(name = "aspect_rules_webpack", version = "0.16.0-rc0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_nodejs", version = "6.1.1")
Language(s) and/or frameworks involved: Java & TypeScript
How to reproduce
No response
Any other information?
No response