salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
224 stars 48 forks source link

BOOT-INF/lib jars are pathed using Bazel internal directory structures #61

Closed plaird closed 3 years ago

plaird commented 3 years ago

Dependency jars should be nested directly under BOOT-INF/lib. But currently we are constructing the spring boot jar with internal details of the build in the form of deeply nested path structures. Spring Boot seems to be able to handle it, but it is poor form.

For maven_install deps, we see paths like: BOOT-INF/lib/bazel-out/darwin-fastbuild/bin/external/maven/v1/https/nexus-proxy-prd.soma.salesforce.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.10.5/jackson-annotations-2.10.5.jar

For internal deps, we see paths like: _BOOT-INF/lib/bazel-out/darwin-fastbuild/bin/projects/libs/acme/blue_lib/libluelib.jar

simontoens commented 3 years ago

@plaird we will have to be careful to handle duplicate names, since there can be targets with the same name under different packages. Not an issue for jars coming from Nexus. Perhaps for internal deps we just keep the root repo path to guarantee uniqueness?

plaird commented 3 years ago

Good point @simontoens perhaps we just trim the 'bazel-out/darwin-fastbuild/bin' segment from the path for internal deps.

plaird commented 3 years ago

While the algorithm isn't full proof, in most cases the jars in BOOT-INF/lib will now be cleaner. See the PR for more details.