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 38,038
    • Issues 38,038
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1,345
    • Merge requests 1,345
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • 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
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Merge requests
  • !8274

Merged
Created Nov 07, 2018 by Dmytro Zaporozhets (DZ)@dzaporozhetsOwner4 of 10 tasks completed4/10 tasks

Resolve "Instance level Maven endpoint"

  • Overview 40
  • Commits 1
  • Pipelines 8
  • Changes 7

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

What are the relevant issue numbers?

#7769 (closed)

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?

Closes #7769 (closed)

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 Nov 27, 2018 by Dmytro Zaporozhets (DZ)
Assignee
Assign to
Reviewer
Request review from
11.6
Milestone
11.6 (Past due)
Assign milestone
Time tracking
Source branch: 7769-instance-level-maven-endpoint