salesforce / salesforce/rules_spring

Fetching dependencies from private maven server causes classes to fail to load

Open
#270 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.7.0 bug
Dominant language
Starlark
Stars
257
Forks
58
PR merge metrics
No merged PRs in 30d

Description

When I fetch my maven dependencies from our corporate maven server (Artifactory) instead of maven central, Spring Boot fails to load the classes from those nested jars. Specifically, I get a ClassNotFoundException on SpringApplication. I confirmed the issue has something to do with the paths inside the jar where the nested dependency jars are located by modifying springboot_pkg.sh so that it just drops all the bazel-out and else case deps into the root of BOOT-INF/lib/...When I bazel run with this modification, I get past the error I was seeing.

My only guess as to why it's failing is the special characters in the credentials that rules_jvm_external adds to the Artifactory path are somehow throwing off the Spring class loader. Ultimately this is probably a bug in Spring, but I think it would be easier to find a fix here.

For more context see discussion https://github.com/salesforce/rules_spring/discussions/267

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with springboot_pkg.sh and reproduce the failure using bazel run with dependencies fetched from the private Artifactory server. Compare the nested-jar paths with the modified script that places bazel-out and else-case dependencies at the root of BOOT-INF/lib/, then use discussion 267 for context; done means SpringApplication and other nested dependency classes load successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.