Hello, I can't find in the documentation, using th...
# general
b
Hello, I can't find in the documentation, using the coursier resolver, how do you setup the credentials ? according to coursier's doc you have to pass them in the url ( https://github.com/coursier/coursier/blob/master/doc/FORMER-README.md#credentials ) but isn't there a way to retrieve these values from a config file ?
w
cc @wide-energy-11069
w
if it’s okay to clear text them in pants.ini, then you should be able to put them in like
Copy code
[coursier]
# Specify remote maven repos
repos: [
    '<https://user:pass@example.com/artifacts/>',
  ]
Please note: I haven’t tested with creds with the default coursier version that pants fetches. If the cred feature came in after the last coursier related change in Pants, that’ll require telling pants to use a later version of coursier
E.g.
Copy code
[coursier]
bootstrap_jar_url: https://.../new-coursier.jar
version: <sha of new version>
b
thank you for the reply, I came up with something in this fashion
Copy code
[DEFAULT]
coursier_login: foo
coursier_password: xxx

[coursier]
# Specify remote maven repos
repos: [
   'https://%(coursier_login)s:%(coursier_password)s@example.com/artifacts/',
 ]
the problem I'm trying to solve is how to isolate the credentials conf for the team members. I understand you can use multiple
ini
files, but it requires to pass them explicitly on the command line. If this is the only way we can always define an alias but is there a way to use en environment variable for exemple ?
w
without code changes, you can probably pass
PANTS_COURSIER_REPOS=....
or we can plumb a special env var for coursier user/pass explicit down in pants
b
having to just set user/pass would be better, but the env var
PANTS_COURSIER_REPOS=
seems pretty nice to start