title: Add GitLab private repository as Maven dependency
body: <p>I have a private repository in GitLab (it's in a group, and I have a Developer role) which I want to add as a dependency for my Maven project.</p>
  
  <p>I've been looking for a while and all I found was that I have to add the following to my pom.xml:</p>
  
  <pre><code>&lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;gitlab-maven&lt;/id&gt;
      &lt;url&gt;https://gitlab.com/api/v4/projects/.../packages/maven&lt;/url&gt;
    &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;distributionManagement&gt;
    &lt;repository&gt;
      &lt;id&gt;gitlab-maven&lt;/id&gt;
      &lt;url&gt;https://gitlab.com/api/v4/projects/.../packages/maven&lt;/url&gt;
    &lt;/repository&gt;
    &lt;snapshotRepository&gt;
      &lt;id&gt;gitlab-maven&lt;/id&gt;
      &lt;url&gt;https://gitlab.com/api/v4/projects/.../packages/maven&lt;/url&gt;
    &lt;/snapshotRepository&gt;
  &lt;/distributionManagement&gt;
  </code></pre>
  
  <p>However, I have no idea how to add the dependency itself (with the groupId and stuff) and I'm not sure how to do authentication to allow Maven to download the project. I've seen something about Personal Access Tokens in GitLab, but I'm not sure how to set that up (I assume I'd only need read-only access?).</p>