Consider supporting maven v2 snapshot dependencies

Summary

When deploying a snapshot dependency, Maven will upload for the metadata:

Maven Metadata
Group ID com.example.dep
Artifact ID simple-maven-dep
Version 1.0-SNAPSHOT

The file:

simple-maven-dep-1.0-20191015.222042-1.jar

However, when downloading, Maven will ask for the URL:

https://gitlab.com/api/v4/projects/14841116/packages/maven/com/example/dep/simple-maven-dep/1.0-SNAPSHOT/simple-maven-dep-1.0-SNAPSHOT.jar

And expect to receive the file above. Currently our API assumes that the file name asked will match the actual file store: https://gitlab.com/gitlab-org/gitlab/blob/master/ee%2Fapp%2Ffinders%2Fpackages%2Fpackage_file_finder.rb#L22

Example Project

https://gitlab.com/tpresa/test-maven-filename

What is the current bug behavior?

You won't be able to download the dependency for the project above when specifying the dep on a pom.xml

What is the expected correct behavior?

You should be able to download the dependency when specifying it on a pom.xml

Output of checks

This bug happens on GitLab.com

ZD https://gitlab.zendesk.com/agent/tickets/134612 (internal)

Edited Nov 06, 2019 by Thiago Presa
Assignee Loading
Time tracking Loading