Forgejo
Deploys staged artifacts to a Forgejo instance via its https://docs.forgejo.io/en-us/packages/maven/[Maven Packages] option.
This feature is primarily intended for deploying artifacts such as JARs and POMs to a Maven compatible repository. If you need to upload any other binaries then check the Forgejo Uploader. |
Publication of snapshots is not allowed. |
Configuration
Legend:
-
required
-
optional
-
may use environment variable
-
accepts Name Templates
#
deploy:
maven:
#
forgejo:
# Deployers require a name.
#
app:
# Enables or disables the deployer.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active: ALWAYS
# URL where the Forgejo service is enabled.
# If left unspecified, the `JRELEASER_FORGEJO_${name}_URL`
# environment variable must be defined.
#
url: https://codeberg.org/api/packages/{{owner}}/maven
# Activates publication of snapshot artifacts.
# Defaults to `false`.
#
snapshotSupported: true
# The username required for authorization.
# If left unspecified, the `JRELEASER_FORGEJO_${name}_USERNAME`
# environment variable must be defined.
#
username: __USE_ENVIRONMENT_VARIABLE__
# Password for login into the FORGEJO service.
# If left unspecified, the `JRELEASER_FORGEJO_${name}_PASSWORD`
# environment variable must be defined.
#
password: __USE_ENVIRONMENT_VARIABLE__
# The authorization method to use.
# Supported values are [`NONE`, `BASIC`, `BEARER`].
# `Basic` requires both username & password.
# `BEARER` requires a token (set as password).
# Defaults to `BEARER`.
#
authorization: BEARER
# Signs artifacts with the configured credentials.
# The Signing section must be configured as well.
# Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
#
sign: false
# Checksums all artifacts with `MD5`, `SHA-1`, `SHA-256`, and `SHA-512`.
# Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
#
checksums: false
# Verifies that a matching `-sources.jar` artifact is staged.
# Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
#
sourceJar: false
# Verifies that a matching `-javadoc.jar` artifact is staged.
# Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
#
javadocJar: false
# Verifies that POM files comply with the minimum requirements for publication
# to Maven Central. Checks rules using PomChecker.
# Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
#
verifyPom: false
# Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
# `-javadoc.jar` artifacts are also staged.
# Defaults to `false`.
#
applyMavenCentralRules: false
# Override artifact configuration
#
artifactOverrides:
# Match artifact by groupId
# If undefined, will use `#{project.java.groupId}`.
#
- groupId: com.acme
# Match artifact by artifactId
#
artifactId: app
# Verifies that a matching `.jar` artifact is staged.
#
jar: false
# Verifies that a matching `-sources.jar` artifact is staged.
#
sourceJar: false
# Verifies that a matching `-javadoc.jar` artifact is staged.
#
javadocJar: false
# Verifies that POM files comply with the minimum requirements for publication
# to Maven Central. Checks rules using PomChecker.
#
verifyPom: false
# List of directories where staged artifacts can be found.
#
stagingRepositories:
- target/staging-deploy
# Defines the connection timeout in seconds.
# Defaults to `20`.
#
connectTimeout: 20
# Defines the read timeout in seconds.
# Defaults to `60`.
#
readTimeout: 60
# Additional properties used when evaluating templates.
#
extraProperties:
# Key will be capitalized and prefixed with `forgejo`, i.e, `forgejoFoo`.
foo: bar
yaml
# Deployers require a name. # [deploy.maven.forgejo.app] # Enables or disables the deployer. # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`]. # Defaults to `NEVER`. # active = "ALWAYS" # URL where the Forgejo service is enabled. # url = "https://codeberg.org/api/packages/{{owner}}/maven" # Activates publication of snapshot artifacts. # Defaults to `false`. # snapshotSupported = true # The username required for authorization. # username = "__USE_ENVIRONMENT_VARIABLE__" # Password for login into the FORGEJO service. # password = "__USE_ENVIRONMENT_VARIABLE__" # The authorization method to use. # Supported values are [`NONE`, `BASIC`, `BEARER`]. # `Basic` requires both username & password. # `BEARER` requires a token (set as password). # Defaults to `BEARER`. # authorization = "BEARER" # Signs artifacts with the configured credentials. # The Signing section must be configured as well. # Defaults to `false` unless `applyMavenCentralRules` is set to `true`. # sign = false # Checksums all artifacts with `MD5`, `SHA-1`, `SHA-256`, and `SHA-512`. # Defaults to `false` unless `applyMavenCentralRules` is set to `true`. # checksums = false # Verifies that a matching `-sources.jar` artifact is staged. # Defaults to `false` unless `applyMavenCentralRules` is set to `true`. # sourceJar = false # Verifies that a matching `-javadoc.jar` artifact is staged. # Defaults to `false` unless `applyMavenCentralRules` is set to `true`. # javadocJar = false # Verifies that POM files comply with the minimum requirements for publication # to Maven Central. Checks rules using PomChecker. # Defaults to `false` unless `applyMavenCentralRules` is set to `true`. # verifyPom = false # Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and # `-javadoc.jar` artifacts are also staged. # Defaults to `false`. # applyMavenCentralRules = false # Override artifact configuration # [[deploy.maven.forgejo.app.artifactOverrides]] # Match artifact by groupId # If undefined, will use `#{project.java.groupId}`. # groupId = "com.acme" # Match artifact by artifactId # artifactId = "app" # Verifies that a matching `.jar` artifact is staged. # jar = false # Verifies that a matching `-sources.jar` artifact is staged. # sourceJar = false # Verifies that a matching `-javadoc.jar` artifact is staged. # javadocJar = false # Verifies that POM files comply with the minimum requirements for publication # to Maven Central. Checks rules using PomChecker. # verifyPom = false # List of directories where staged artifacts can be found. # stagingRepositories = ["target/staging-deploy"] # Defines the connection timeout in seconds. # Defaults to `20`. # connectTimeout = 20 # Defines the read timeout in seconds. # Defaults to `60`. # readTimeout = 60 # Additional properties used when evaluating templates. # extraProperties.foo = "bar" # Key will be capitalized and prefixed with `forgejo`, i.e, `forgejoFoo`.
toml
{
//
"deploy": {
"maven": {
//
"forgejo": {
// Deployers require a name.
//
"app": {
// Enables or disables the deployer.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
"active": "ALWAYS",
// URL where the Forgejo service is enabled.
//
"url": "https://codeberg.org/api/packages/{{owner}}/maven",
// Activates publication of snapshot artifacts.
// Defaults to `false`.
//
"snapshotSupported": true,
// The username required for authorization.
//
"username": "__USE_ENVIRONMENT_VARIABLE__",
// Password for login into the FORGEJO service.
//
"password": "__USE_ENVIRONMENT_VARIABLE__",
// The authorization method to use.
// Supported values are [`NONE`, `BASIC`, `BEARER`].
// `Basic` requires both username & password.
// `BEARER` requires a token (set as password).
// Defaults to `BEARER`.
//
"authorization": "BEARER",
// Signs artifacts with the configured credentials.
// The Signing section must be configured as well.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
"sign": false,
// Checksums all artifacts with `MD5`, `SHA-1`, `SHA-256`, and `SHA-512`.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
"checksums": false,
// Verifies that a matching `-sources.jar` artifact is staged.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
"sourceJar": false,
// Verifies that a matching `-javadoc.jar` artifact is staged.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
"javadocJar": false,
// Verifies that POM files comply with the minimum requirements for publication
// to Maven Central. Checks rules using PomChecker.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
"verifyPom": false,
// Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
// `-javadoc.jar` artifacts are also staged.
// Defaults to `false`.
//
"applyMavenCentralRules": false,
// Override artifact configuration
//
"artifactOverrides": [
{
// Match artifact by groupId
// If undefined, will use `#{project.java.groupId}`.
//
"groupId": "com.acme",
// Match artifact by artifactId
//
"artifactId": "app",
// Verifies that a matching `.jar` artifact is staged.
//
"jar": false,
// Verifies that a matching `-sources.jar` artifact is staged.
//
"sourceJar": false,
// Verifies that a matching `-javadoc.jar` artifact is staged.
//
"javadocJar": false,
// Verifies that POM files comply with the minimum requirements for publication
// to Maven Central. Checks rules using PomChecker.
//
"verifyPom": false
}
]
// List of directories where staged artifacts can be found.
//
"stagingRepositories": [
"target/staging-deploy"
],
// Defines the connection timeout in seconds.
// Defaults to `20`.
//
"connectTimeout": 20,
// Defines the read timeout in seconds.
// Defaults to `60`.
//
"readTimeout": 60,
// Additional properties used when evaluating templates.
//
"extraProperties": {
// Key will be capitalized and prefixed with `forgejo`, i.e, `forgejoFoo`.
"foo": "bar"
}
}
}
}
}
}
json
<jreleaser>
<!--
-->
<deploy>
<maven>
<!--
-->
<forgejo>
<!--
Deployers require a name.
-->
<app>
<!--
Enables or disables the deployer.
Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
Defaults to `NEVER`.
-->
<active>ALWAYS</active>
<!--
URL where the Forgejo service is enabled.
-->
<url>https://codeberg.org/api/packages/{{owner}}/maven</url>
<!--
Activates publication of snapshot artifacts.
Defaults to `false`.
-->
<snapshotSupported>true</snapshotSupported>
<!--
The username required for authorization.
-->
<username>__USE_ENVIRONMENT_VARIABLE__</username>
<!--
Password for login into the FORGEJO service.
-->
<password>__USE_ENVIRONMENT_VARIABLE__</password>
<!--
The authorization method to use.
Supported values are [`NONE`, `BASIC`, `BEARER`].
`Basic` requires both username & password.
`BEARER` requires a token (set as password).
Defaults to `BEARER`.
-->
<authorization>BEARER</authorization>
<!--
Signs artifacts with the configured credentials.
The Signing section must be configured as well.
Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
-->
<sign>false</sign>
<!--
Checksums all artifacts with `MD5`, `SHA-1`, `SHA-256`, and `SHA-512`.
Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
-->
<checksums>false</checksums>
<!--
Verifies that a matching `-sources.jar` artifact is staged.
Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
-->
<sourceJar>false</sourceJar>
<!--
Verifies that a matching `-javadoc.jar` artifact is staged.
Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
-->
<javadocJar>false</javadocJar>
<!--
Verifies that POM files comply with the minimum requirements for publication
to Maven Central. Checks rules using PomChecker.
Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
-->
<verifyPom>false</verifyPom>
<!--
Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
`-javadoc.jar` artifacts are also staged.
Defaults to `false`.
-->
<applyMavenCentralRules>false</applyMavenCentralRules>
<!--
Override artifact configuration
-->
<artifactOverrides>
<artifactOverride>
<!--
Match artifact by groupId
If undefined, will use `#{project.java.groupId}`.
-->
<groupId>com.acme</groupId>
<!--
Match artifact by artifactId
-->
<artifactId>app</artifactId>
<!--
Verifies that a matching `.jar` artifact is staged.
-->
<jar>false</jar>
<!--
Verifies that a matching `-sources.jar` artifact is staged.
-->
<sourceJar>false</sourceJar>
<!--
Verifies that a matching `-javadoc.jar` artifact is staged.
-->
<javadocJar>false</javadocJar>
<!--
Verifies that POM files comply with the minimum requirements for publication
to Maven Central. Checks rules using PomChecker.
-->
<verifyPom>false</verifyPom>
</artifactOverride>
</artifactOverrides>
<!--
List of directories where staged artifacts can be found.
-->
<stagingRepositories>
<stagingRepository>target/staging-deploy</stagingRepository>
</stagingRepositories>
<!--
Defines the connection timeout in seconds.
Defaults to `20`.
-->
<connectTimeout>20</connectTimeout>
<!--
Defines the read timeout in seconds.
Defaults to `60`.
-->
<readTimeout>60</readTimeout>
<!--
Additional properties used when evaluating templates.
-->
<extraProperties>
<!--
Key will be capitalized and prefixed with `forgejo`, i.e, `forgejoFoo`.
-->
<foo>bar</foo>
</extraProperties>
</app>
</forgejo>
</maven>
</deploy>
</jreleaser>
xml
jreleaser {
//
deploy {
maven {
//
forgejo {
// Deployers require a name.
//
app {
// Enables or disables the deployer.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
active = 'ALWAYS'
// URL where the Forgejo service is enabled.
//
url = 'https://codeberg.org/api/packages/{{owner}}/maven'
// Activates publication of snapshot artifacts.
// Defaults to `false`.
//
snapshotSupported = true
// The username required for authorization.
//
username = '__USE_ENVIRONMENT_VARIABLE__'
// Password for login into the FORGEJO service.
//
password = '__USE_ENVIRONMENT_VARIABLE__'
// The authorization method to use.
// Supported values are [`NONE`, `BASIC`, `BEARER`].
// `Basic` requires both username & password.
// `BEARER` requires a token (set as password).
// Defaults to `BEARER`.
//
authorization = 'BEARER'
// Signs artifacts with the configured credentials.
// The Signing section must be configured as well.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
sign = false
// Checksums all artifacts with `MD5`, `SHA-1`, `SHA-256`, and `SHA-512`.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
checksums = false
// Verifies that a matching `-sources.jar` artifact is staged.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
sourceJar = false
// Verifies that a matching `-javadoc.jar` artifact is staged.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
javadocJar = false
// Verifies that POM files comply with the minimum requirements for publication
// to Maven Central. Checks rules using PomChecker.
// Defaults to `false` unless `applyMavenCentralRules` is set to `true`.
//
verifyPom = false
// Verifies pom files, signs all artifacts, verifies that matching `-sources.jar` and
// `-javadoc.jar` artifacts are also staged.
// Defaults to `false`.
//
applyMavenCentralRules = false
// Override artifact configuration
//
artifactOverride {
// Match artifact by groupId
// If undefined, will use `#{project.java.groupId}`.
//
groupId = 'com.acme'
// Match artifact by artifactId
//
artifactId = 'app'
// Verifies that a matching `.jar` artifact is staged.
//
jar = false
// Verifies that a matching `-sources.jar` artifact is staged.
//
sourceJar = false
// Verifies that a matching `-javadoc.jar` artifact is staged.
//
javadocJar = false
// Verifies that POM files comply with the minimum requirements for publication
// to Maven Central. Checks rules using PomChecker.
//
verifyPom = false
}
// List of directories where staged artifacts can be found.
//
stagingRepository('target/staging-deploy')
// Defines the connection timeout in seconds.
// Defaults to `20`.
//
connectTimeout = 20
// Defines the read timeout in seconds.
// Defaults to `60`.
//
readTimeout = 60
// Additional properties used when evaluating templates.
// Key will be capitalized and prefixed with `forgejo`, i.e, `forgejoFoo`.
//
extraProperties.put('foo', 'bar')
}
}
}
}
}
groovy
Environment
When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.
System Property | Environment Variable |
---|---|
active |
|
jreleaser.deploy.maven.forgejo.${name}.active |
JRELEASER_DEPLOY_MAVEN_FORGEJO_${name}_ACTIVE |
url |
|
jreleaser.deploy.maven.forgejo.${name}.url |
JRELEASER_DEPLOY_MAVEN_FORGEJO_${name}_URL |
username |
|
jreleaser.deploy.maven.forgejo.${name}.username |
JRELEASER_DEPLOY_MAVEN_FORGEJO_${name}_USERNAME |
password |
|
jreleaser.deploy.maven.forgejo.${name}.password |
JRELEASER_DEPLOY_MAVEN_FORGEJO_${name}_PASSWORD |
Substitute ${name} for the value of the named instance. |
Space (' '), underscore (_
), and dash (-
) will be replaced by dot (.
) to separate tokens in the System property.
Space (' '), dash (-
), and dot (.
) will be replaced by underscore (_
) to separate tokens in the environment variable,
such that:
${name} | System Property | Environment Variable |
---|---|---|
foobar |
|
|
fooBar |
|
|
foo bar |
|
|
foo-bar |
|
|
foo_bar |
|
|
foo.bar |
|
|
Example
deploy:
maven:
forgejo:
app:
active: ALWAYS
url: https://codeberg.org/api/packages/{{owner}}/maven
stagingRepositories:
- target/staging-deploy
yaml
[deploy.maven.forgejo.app] active = "ALWAYS" host = "https://codeberg.org/api/packages/{{owner}}/maven" stagingRepositories = ["target/staging-deploy"]
toml
{
"jreleaser": {
"deploy": {
"maven": {
"forgejo": {
"app": {
"active": "ALWAYS",
"host": "https://codeberg.org/api/packages/{{owner}}/maven",
"stagingRepositories": [
"target/staging-deploy"
]
}
}
}
}
}
}
json
<jreleaser>
<deploy>
<maven>
<forgejo>
<app>
<active>ALWAYS</active>
<host>https://codeberg.org/api/packages/{{owner}}/maven</host>
<stagingRepositories>target/staging-deploy</stagingRepositories>
</app>
</forgejo>
</maven>
</deploy>
</jreleaser>
xml
jreleaser {
deploy {
maven {
forgejo {
app {
active = 'ALWAYS'
host = 'https://codeberg.org/api/packages/{{owner}}/maven'
stagingRepository('target/staging-deploy')
}
}
}
}
}
groovy
Any of the following environment variables may be defined to supply values for username
and password
:
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_APP_USERNAME
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_USERNAME
-
JRELEASER_FORGEJO_APP_USERNAME
-
JRELEASER_FORGEJO_USERNAME
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_APP_PASSWORD
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_APP_TOKEN
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_PASSWORD
-
JRELEASER_DEPLOY_MAVEN_FORGEJO_TOKEN
-
JRELEASER_FORGEJO_APP_PASSWORD
-
JRELEASER_FORGEJO_APP_TOKEN
-
JRELEASER_FORGEJO_PASSWORD
-
JRELEASER_FORGEJO_TOKEN