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 35,023
    • Issues 35,023
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,264
    • Merge Requests 1,264
  • 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
  • !6607

Merged
Opened Jul 20, 2018 by Dmytro Zaporozhets (DZ)@dzaporozhets🔧Owner10 of 13 tasks completed10/13 tasks

Adds support to upload and download maven packages from/to GitLab

  • Overview 139
  • Commits 55
  • Pipelines 53
  • Changes 38

What does this MR do?

Adds support to upload and download maven packages from GitLab.

  • I tested upload with for both mvn deploy and mvn release:perform.
  • EEP feature; must be enabled in config
  • Uses workhorse file upload
  • Should be compatible with object storage

Why was this MR needed?

So people can add GitLab to their pom.xml file and upload/download packages from GitLab

How to test

  1. Checkhout this branch
  2. Get workhorse changes gitlab-workhorse!283 (comment 91229181)
  3. Setup ~/.m2/settings.xml with username and token. See doc in diff for example
  4. Create maven project and add GitLab repo to pom.xml. See doc in diff for example

Screenshots (if relevant)

No UI here. UI is in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6781/diffs

Here is terminal output from mvn deploy:

dzaporozhets:~/Projects/mvn-example master 
→ mvn deploy
...
[INFO] --- maven-install-plugin:2.4:install (default-install) @ my-app ---
[INFO] Installing /Users/dzaporozhets/Projects/mvn-example/target/my-app-1.1-SNAPSHOT.jar to /Users/dzaporozhets/.m2/repository/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-SNAPSHOT.jar
[INFO] Installing /Users/dzaporozhets/Projects/mvn-example/pom.xml to /Users/dzaporozhets/.m2/repository/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ my-app ---
Downloading from gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/maven-metadata.xml
Downloaded from gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/maven-metadata.xml (767 B at 118 B/s)
Uploading to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-20180806.161455-3.jar
Uploaded to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-20180806.161455-3.jar (2.6 kB at 3.3 kB/s)
Uploading to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-20180806.161455-3.pom
Uploaded to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/my-app-1.1-20180806.161455-3.pom (2.0 kB at 3.1 kB/s)
Downloading from gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/maven-metadata.xml
Downloaded from gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/maven-metadata.xml (319 B at 809 B/s)
Uploading to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/maven-metadata.xml
Uploaded to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/1.1-SNAPSHOT/maven-metadata.xml (767 B at 1.1 kB/s)
Uploading to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/maven-metadata.xml
Uploaded to gitlab-maven: http://localhost:3001/api/v4/projects/1/packages/maven/com/mycompany/app/my-app/maven-metadata.xml (319 B at 50 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.331 s
[INFO] Finished at: 2018-08-06T19:15:04+03:00
[INFO] Final Memory: 16M/55M
[INFO] ------------------------------------------------------------------------

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • API support added
  • Tests added for this feature/bug
  • Conforms to the code review guidelines
    • [-] Has been reviewed by a UX Designer
    • [-] Has been reviewed by a Frontend maintainer
    • Has been reviewed by a Backend maintainer
    • Has been reviewed by a Database specialist
  • EE specific content should be in the top level /ee folder
  • Conforms to the merge request performance guidelines
  • Conforms to the style guides
  • Conforms to the database guides
  • If you have multiple commits, please combine them into a few logically organized commits by squashing them
  • [-] Internationalization required/considered
  • If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan
  • End-to-end tests pass (package-and-qa manual pipeline job)

What are the relevant issue numbers?

Closes #5811 (closed)

Edited Aug 15, 2018 by Dmytro Zaporozhets (DZ)
Assignee
Assign to
Reviewer
Request review from
11.3
Milestone
11.3 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab!6607
Source branch: 5811-add-maven-support-to-our-artifact-repository-mvc

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.