Maven Package Registry
Publish Maven packages for your user or organization.
Requirements
To work with the Maven package registry, you can use Maven or Gradle.
The following examples use Maven
and Gradle Groovy
.
Configuring the package registry
To register the package registry you first need to add your access token to the settings.xml
file:
Afterwards add the following sections to your project pom.xml
file:
Parameter | Description |
---|---|
access_token | Your personal access token. |
owner | The owner of the package. |
Gradle variant
When you plan to add some packages from Forgejo instance in your project, you should add it in repositories section:
In Groovy gradle you may include next script in your publishing part:
Publish a package
To publish a package simply run:
Or call gradle
with task publishAllPublicationsToForgejoRepository
in case you are using gradle:
If you want to publish a prebuild package to the registry, you can use mvn deploy:deploy-file
:
Parameter | Description |
---|---|
owner | The owner of the package. |
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
Install a package
To install a Maven package from the package registry, add a new dependency to your project pom.xml
file:
And analog in gradle groovy:
Afterwards run: