Instance level Maven endpoint (second attempt)
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 by Dmytro Zaporozhets (DZ)