Commit e4911fa9 authored by Marcin Zajączkowski's avatar Marcin Zajączkowski

Improve sample curl commands with Maven artifacts fetching

Missing artifactId and version in the path section was confusing for people trying to use it.

There might be still a problem with the JAR versioning scheme for SNAPSHOTs in Maven (with timestamp),
but it is a separate issue and I didn't want to mix it in one MR.
parent b836cd3d
......@@ -36,13 +36,13 @@ GET packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. |
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar"
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
```
To write the output to file:
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
......@@ -63,13 +63,13 @@ GET groups/:id/-/packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. |
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar"
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
```
To write the output to file:
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/groups/1/-/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
......@@ -90,13 +90,13 @@ GET projects/:id/packages/maven/*path/:file_name
| `file_name` | string | yes | The name of the Maven package file. |
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar"
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar"
```
To write the output to file:
```shell
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
curl --header "Private-Token: <personal_access_token>" "https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.jar" >> mypkg-1.0-SNAPSHOT.jar
```
This writes the downloaded file to `mypkg-1.0-SNAPSHOT.jar` in the current directory.
......@@ -120,5 +120,5 @@ PUT projects/:id/packages/maven/*path/:file_name
curl --request PUT \
--upload-file path/to/mypkg-1.0-SNAPSHOT.pom \
--header "Private-Token: <personal_access_token>" \
"https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/baz/mypkg-1.0-SNAPSHOT.pom"
"https://gitlab.example.com/api/v4/projects/1/packages/maven/foo/bar/mypkg/1.0-SNAPSHOT/mypkg-1.0-SNAPSHOT.pom"
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment