We have a JFrog artifactory that contains a maven repo (and other elements).
In my gradle setup, I defined this:
repositories {
maven {
url = uri("https://eu.artifactory....../whatever/")
credentials {
username = "my-full-user-id"
password = "my-real-password"
}
}
}
Works fine. It also works when I change the password entry to use my JFrog API KEY.
But: using the api key only works when username
contains my real user id.
Whereas: when making https requests "directly" to JFrog (for example using a python script), it is not required to provide a user name: simply having the API KEY in the request header is enough.
Thing is: in our setup, we have the API key at hand, but not the user id. So I had hoped to be able to define a maven dependency in gradle that works without user names.
But when
- I leave username blank in my gradle setup, gradle complains about it being null.
- I try anything else but my real user id, I get a
401 Unauthorized
response
Question: is it possible to use "maven style" repository definition in gradle that works with API KEYS and that doesn't need the corresponding user ids?
question from:
https://stackoverflow.com/questions/66061464/how-to-access-a-maven-repo-on-artifactory-in-gradle-using-api-key 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…