9

I try to use credentials in my build.sbt config in order to retrieve private artifacts from a gitlab private maven repository.

But as sbt documentation states :

The credentials file is a properties file with keys realm, host, user, and password.

And gitab private maven documentation states :

If a project is private or you want to upload Maven artifacts to GitLab, credentials will need to be provided for authorization. Support is available for personal access tokens and CI job tokens only. Deploy tokens and regular username/password credentials do not work.

The only way to authenticate when fetching or pushing artifacts to gitlab maven private repository is to use a maven settings.xml file with :

<settings>
  <servers>
    <server>
      <id>gitlab-maven</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Private-Token</name>
            <value>REPLACE_WITH_YOUR_PERSONAL_ACCESS_TOKEN</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
  </servers>
</settings>

I found a workaround to push my private artifacts (intermediate step locally) but I am out of options to use these private artifacts as libraryDependencies in other scala repositories.

  • Is there anyway to have sbt fetching my private gitlab repository with the required httpHeaders ?
  • Do you know any workaround (multi-step fetchs) to have my private artifacts retrieved ?
kheraud
  • 5,048
  • 7
  • 46
  • 75
  • I'm not sure where the configuration things is coming from ? Based on the [docs of Maven settings.xml](https://maven.apache.org/settings.html) those things do not exist in Maven? – khmarbaise Apr 24 '19 at 17:32
  • We can find these settings in [maven wagon doc](https://maven.apache.org/guides/mini/guide-http-settings.html) – kheraud Apr 25 '19 at 07:56

0 Answers0