Skip to content

Credentials are ignored #29

Description

@rabejens

I set up a new Gitlab token with api access, then I created ~/.sbt/.gitlab.credentials like so:

realm=mygroup
host=my.company.com
user=Private-Token
password=REDACTED

In my build.sbt I have:

ThisBuild / useCoursier := false

credentials += Credentials(Path.userHome / ".sbt" / ".gitlab.credentials")
resolvers += "mygroup" at "https://my.company.com/api/v4/groups/420/-/packages/maven"

Now,

libraryDependencies += "com.company.my" %% "my-lib" % "1.2.3"

But it still can't find the package. It seems to ignore the credentials:

[warn] 	module not found: com.company.my#my-lib_2.12;1.2.3
[warn] ==== local: tried
[warn]   C:\Users\MyUsername\.ivy2\local\com.company.my\my-lib_2.12\1.2.3\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/company/my/my-lib_2.12/1.2.3/my-lib_2.12-1.2.3.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   C:\Users\MyUsername\.sbt\preloaded\com.company.my\my-lib_2.12\1.2.3\ivys\ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:/C:/Users/MyUsername/.sbt/preloaded/com/company/my/my-lib_2.12/1.2.3/my-lib_2.12-1.2.3.pom
[warn] ==== mygroup: tried
[warn]   https://my.company.com/api/v4/groups/420/-/packages/maven/com/company/my/my-lib_2.12/1.2.3/my-lib_2.12-1.2.3.pom

When I follow the link and log in to our company Gitlab previously, the POM is downloaded fine.

What is going wrong here? What am I missing?

When I set up a Maven project accessing this repo, everything works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions