edbras
edbras

Reputation: 4404

How to access a private Gitlab maven repository from a azure devops pipeline?

How can I access a private maven Repository at Gitlab during my java build in an azure pipeline that has a dependency to a jar file in the repo at Gitlab?

There is this MavenAuthenticateV0 task but that expect the maven config to be in the following format:

<server>
    <id>feedName</id>
    <username>Authorization</username>
    <password>token</password>
</server>

While Gitab expects:

<server>
  <id>feedName</id>
  <configuration>
    <httpHeaders>
      <property>
        <name>Authorization</name>
        <value>token</value>
      </property>
    </httpHeaders>
  </configuration>
</server>

How to solve this?

Upvotes: 0

Views: 432

Answers (1)

Hugh Lin
Hugh Lin

Reputation: 19431

As a workaround , you can try to specify setting.xml in the option argument of maven task:

- task: Maven@1
  inputs:
    mavenPomFile: 'pom.xml'
    goals: deploy
    options: '--settings .mvn/settings.xml'

Here is a ticket you can refer to.

Upvotes: 1

Related Questions