Closed jwharm closed 11 months ago
A bit more detail: A HTTP 404 response throws a FileNotFoundException
but other errors, like the 401 in my case, throw a plain IOException
. I don't know why jitpack responds with 401, but if we'd change FileNotFoundException
to IOException
in line 360 and 409 of DependencyResolver.java
, the resolver should treat all HTTP error codes equally.
I can test and submit a PR for this, or is there a specific reason the resolver currently specifically catches FileNotFoundException
only?
I'm sorry, I don't seem to have gotten a notification about this issue and only saw it now.
It seems that the jetpack.io repository needs authentication to be able to retrieve those artifacts, HTTP 401 means it's not authorized. You can provide the login and password to bld in order to get access. An example of how to not include those credentials in your project can be found here: https://github.com/rife2/bld/wiki/Sensitive-and-Common-Data
Hope this helps.
I have two repositories configured, one is jitpack.io and the other is the OSSRH snapshot repository.
The dependency should download a bunch of other dependencies, from both declared repositories. Running
bld download
results in an error:I think the error is thrown here: https://github.com/rife2/bld/blob/main/src/main/java/rife/bld/dependencies/DependencyResolver.java#L363
Because the snapshot artifact is not found in the first repository (jitpack.io), the HTTP GET throws an
IOException: Server returned HTTP response code: 401 for URL: ...
that is not handled, so it throws anArtifactRetrievalErrorException
which stops the build process.