bazel-contrib / bazel-contrib/rules_jvm_external
Failed to get artifact from private repo when using URL basic auth
- Dominant language
- Java
- Stars
- 373
- Forks
- 301
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 5
Description
Hi all, I have artifacts hosted on a private repository using jfrog. In my workspace file, I have a `maven_install` rule with
```
artifacts = [
'com.functorz:ztype:0.3.19',
],
repositories = [
"https://repo1.maven.org/maven2",
"https://geoff%40functorz.com:@functorz.jfrog.io/artifactory/maven",
]
```
and in a build rule, I have a dependency on `@maven//:com_functorz_ztype`. Running `bazel build` yields the following error:
```
Resolution error: Error downloading com.functorz:ztype:0.3.19
not found: https://repo1.maven.org/maven2/com/functorz/ztype/0.3.19/ztype-0.3.19.pom
forbidden: https://functorz.jfrog.io/artifactory/maven/com/functorz/ztype/0.3.19/ztype-0.3.19.pom
```
Some observations:
- Trying it with `curl` for `https://geoff%40functorz.com:@functorz.jfrog.io/artifactory/maven/com/functorz/ztype/0.3.19/ztype-0.3.19.pom` returns the pom file successfully
- Using a credentials file via `COURSIER_CREDENTIALS` works as well
My best guess at the moment is that both my username (email) and password have special characters in them. I used url encoded versions of them in the URL, which works fine for curl. Is it possible that in the interactions between Bazel and Coursier, this case isn't handled properly?
Anyway, just a guess. Happy to help debug and provide more info if needed.
Contributor guide
Research direction
Reproduce the failure with the shown workspace maven_install configuration and a bazel build of @maven//:com_functorz_ztype. Compare URL basic authentication with the working COURSIER_CREDENTIALS case; done when the private JFrog artifact resolves successfully using the URL credentials.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100