Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
78326f28
Commit
78326f28
authored
Jan 20, 2021
by
Suzanne Selhorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added duplicate and instance, group, project info
Related to:
https://gitlab.com/gitlab-org/gitlab/-/issues/289938
parent
470a3fe3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
doc/user/packages/maven_repository/index.md
doc/user/packages/maven_repository/index.md
+22
-11
No files found.
doc/user/packages/maven_repository/index.md
View file @
78326f28
...
...
@@ -186,10 +186,11 @@ published to the GitLab Package Registry.
## Authenticate to the Package Registry with Maven
To authenticate to the Package Registry, you need
either a personal access token or deploy token.
To authenticate to the Package Registry, you need
one of the following:
- If you use a [personal access token](../../../user/profile/personal_access_tokens.md), set the scope to `api`.
- If you use a [deploy token](../../project/deploy_tokens/index.md), set the scope to `read_package_registry`, `write_package_registry`, or both.
- A [personal access token](../../../user/profile/personal_access_tokens.md) with the scope set to `api`.
- A [deploy token](../../project/deploy_tokens/index.md) with the scope set to `read_package_registry`, `write_package_registry`, or both.
- A [CI_JOB_TOKEN](#authenticate-with-a-ci-job-token-in-maven).
### Authenticate with a personal access token in Maven
...
...
@@ -354,12 +355,13 @@ repositories {
To use the GitLab endpoint for Maven packages, choose an option:
- **Project-level**: Use when you have few Maven packages and they are not in
the same GitLab group.
- **Group-level**: Use when you have many Maven packages in the same GitLab
group.
- **Instance-level**: Use when you have many Maven packages in different
GitLab groups or in their own namespace.
- **Project-level**: To publish Maven packages to a project, use a project-level endpoint.
To install Maven packages, use a project-level endpoint when you have few Maven packages
and they are not in the same GitLab group.
- **Group-level**: Use a group-level endpoint when you want to install packages from
many different projects in the same GitLab group.
- **Instance-level**: Use an instance-level endpoint when you want to install many
packages from different GitLab groups or in their own namespace.
The option you choose determines the settings you add to your `pom.xml` file.
...
...
@@ -533,7 +535,7 @@ repositories {
After you have set up the [remote and authentication](#authenticate-to-the-package-registry-with-maven)
and [configured your project](#use-the-gitlab-endpoint-for-maven-packages),
publish a Maven
artifact from
your project.
publish a Maven
package to
your project.
### Publish by using Maven
...
...
@@ -604,11 +606,20 @@ To publish a package by using Gradle:
Now navigate to your project's **Packages & Registries** page and view the published artifacts.
### Publishing a package with the same name or version
When you publish a package with the same name or version as an existing package,
the existing package is overwritten.
## Install a package
To install a package from the GitLab Package Registry, you must configure
the [remote and authenticate](#authenticate-to-the-package-registry-with-maven).
When this is completed, there are two ways to install a package.
When this is completed, you can install a package from a project,
group, or namespace.
If multiple packages have the same name and version, when you install
a package, the most recently-published package is retrieved.
### Use Maven with `mvn install`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment