Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,985
    • Issues 34,985
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,269
    • Merge Requests 1,269
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Merge Requests
  • !8757

Merged
Opened Dec 07, 2018 by Dmytro Zaporozhets (DZ)@dzaporozhets🔧Owner3 of 11 tasks completed3/11 tasks

Instance level Maven endpoint (second attempt)

  • Overview 22
  • Commits 4
  • Pipelines 7
  • Changes 8

What does this MR do?

Adds instance level API endpoint for downloading maven packages.

So you can add multiple dependencies to your pom.xml and use a single URL like to download any of them

Same as https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8274 but requires package name and project name to be equal to work.

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/7769

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • Tests added for this feature/bug
  • Conforms to the code review guidelines
  • Conforms to the merge request performance guidelines
  • Conforms to the style guides
  • Conforms to the database guides
  • Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
  • EE specific content should be in the top level /ee folder
  • For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan?
  • Security reports checked/validated by reviewer

How it works

I add 2 dependencies to my pom.xml. Both are stored in GitLab maven repository. Then I add a single instance-level URL for repository.

  <dependencies>
    <dependency>
      <groupId>com.mycompany.app</groupId>
      <artifactId>my-app</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>com.mycompany.app</groupId>
      <artifactId>z-app</artifactId>
      <version>1.5-SNAPSHOT</version>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>gitlab-maven</id>
      <url>http://localhost:3001/api/v4/packages/maven</url>
    </repository>
  </repositories>

So when I install package it will download both dependencies from GitLab

→ mvn -U install
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building o-my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/maven-metadata.xml (767 B at 1.6 kB/s)
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-20180823.081121-4.pom
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-20180823.081121-4.pom (1.6 kB at 5.6 kB/s)
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/maven-metadata.xml
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/maven-metadata.xml (766 B at 2.8 kB/s)
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/z-app-1.5-20181127.093424-1.pom
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/z-app-1.5-20181127.093424-1.pom (1.1 kB at 3.4 kB/s)
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-20180823.081121-4.jar
Downloading from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/z-app-1.5-20181127.093424-1.jar
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/z-app/1.5-SNAPSHOT/z-app-1.5-20181127.093424-1.jar (2.4 kB at 8.4 kB/s)
Downloaded from gitlab-maven: http://localhost:3001/api/v4/packages/maven/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-20180823.081121-4.jar (2.5 kB at 8.7 kB/s)
Edited Dec 12, 2018 by Dmytro Zaporozhets (DZ)
Assignee
Assign to
Reviewer
Request review from
11.7
Milestone
11.7 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab!8757
Source branch: dz-instance-level-maven-endpoint

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.