Closed thundergolfer closed 4 years ago
In addition to difference in dependency layout, recent versions of rules_jvmexternal (at least 3.0 and 3.1) prepend each jar with `stamped`. This causes springboot_pkg.sh (here) to fail to extract the spring-boot-loader classes and place them at the root level of the jar.
This results in
Error: Could not find or load main class org.springframework.boot.loader.JarLauncher
when trying to run the jar.
Changing the condition to $libname == *spring-boot-loader*
or $libname == stamped_spring-boot-loader*
corrects the problem. The former is backward-compatible and should continue to work with native.maven_jar (although I have not tested it myself).
Apologies for missing this - years ago I toned down my email notifications from GH and forgot about it. I have re-added email notifications to my settings.
I will get this in our current/next sprint and will address. Thanks so much for reporting.
See a related discussion on bazel-eclipse-discuss: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/bazel-eclipse-discuss/87Va4oGscgM
All of my deps from rules_jvm_external show up like this:
BOOT-INF/lib/bazel-out/darwin-fastbuild/bin/external/maven/v1/https/repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.9.8/stamped_jackson-dataformat-cbor-2.9.8.jar
If they aren't root in BOOT-INF/lib will they still work?
If you are using rules_jvm_external, no I don't think this rule will work as-is. Our attempt to transition our internal monorepo last sprint to rules_jvm_external hit some snags, so we haven't yet vetted the associated springboot rule changes. We will have an internal release of another major project our team owns this week, but soon after we should have the cycles to update this repo.
In the meantime, please try what thundergolfer/dan-cohn recommended. Post back if that solution doesn't work for you.
@plaird I was able to get things to work with their recommended solutions and also changing the directory to which the jars are placed to BOOT-INF/lib
I merged into the master the fixes provided by @thundergolfer and @dan-cohn in PR #20. I will close this ticket, and finish full support (docs, import bundles) in issue #4 .
Thanks for the contributions!
Description
As
rules_jvm_external
lays out deps differently to thenative.maven_jar
repo rule used in the example, things don't work right now if you use the former.I collected the
SRCS
passed intowrite_manifest.sh
to show this:The first
ERROR
you get is:Fortunately it was quite easy to get at least the basics working with
rules_jvm_external
by make 2 changes to pattern matching lines here and here.At https://github.com/thundergolfer/the-one-true-bazel-monorepo/commit/dc7d2c66fbe2816d83f3979b05275f1935a7874a I can now get this rule working I think, as doing
bazel run //store-api/src/main/java/com/book/store/api:deployable
works 👍.Note, this may be a dupe/sibling of https://github.com/salesforce/bazel-springboot-rule/issues/4