Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Nov 10, 2022
1 parent b2209f9 commit e417ee9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 15 deletions.
53 changes: 47 additions & 6 deletions docs/modules/configuration/pages/deploy/maven/nexus2.adoc
Expand Up @@ -3,6 +3,7 @@
:deployer_name: Nexus2
:prefix: NEXUS2
:deployer_url: https://s01.oss.sonatype.org/service/local
:deployer_snapshot_url: https://s01.oss.sonatype.org/content/repositories/snapshot
:default_auth: BASIC

Deploys staged artifacts to link:https://help.sonatype.com/repomanager2[Sonatype {deployer_name} Repository Manager] instance.
Expand All @@ -11,8 +12,6 @@ NOTE: You may use this deployer to publish releases to link:https://search.maven

IMPORTANT: This feature *does not* support deploying artifacts other than JARs and POMs to a Maven compatible repository.

WARNING: Publication of snapshots is *not* allowed.

include::partial$legend.adoc[]

[tabs]
Expand All @@ -25,6 +24,12 @@ YAML::
----
include::partial$deploy/maven/yaml/common-head.adoc[]
# URL where the {deployer_name} snapshots are enabled.
# If left unspecified, the `JRELEASER_{prefix}_${name}_SNAPSHOT_URL`
# environment variable must be defined.
# icon:exclamation-triangle[] icon:eye-slash[]
snapshotUrl: {deployer_snapshot_url}
# Closes the staging repository.
# Defaults to `false`.
# icon:dot-circle[]
Expand Down Expand Up @@ -54,6 +59,12 @@ TOML::
----
include::partial$deploy/maven/toml/common-head.adoc[]
# URL where the {deployer_name} snapshots are enabled.
# If left unspecified, the `JRELEASER_{prefix}_${name}_SNAPSHOT_URL`
# environment variable must be defined.
# icon:exclamation-triangle[] icon:eye-slash[]
snapshotUrl = "{deployer_snapshot_url}"
# Closes the staging repository.
# Defaults to `false`.
# icon:dot-circle[]
Expand Down Expand Up @@ -83,6 +94,12 @@ JSON::
----
include::partial$deploy/maven/json/common-head.adoc[]
// URL where the {deployer_name} snapshots are enabled.
// If left unspecified, the `JRELEASER_{prefix}_${name}_SNAPSHOT_URL`
// environment variable must be defined.
// icon:exclamation-triangle[] icon:eye-slash[]
"snapshotUrl": "{deployer_snapshot_url}",
// Closes the staging repository.
// Defaults to `false`.
// icon:dot-circle[]
Expand Down Expand Up @@ -113,6 +130,14 @@ Maven::
----
include::partial$deploy/maven/maven/common-head.adoc[]
<!--
URL where the {deployer_name} snapshots are enabled.
If left unspecified, the `JRELEASER_{prefix}_${name}_SNAPSHOT_URL`
environment variable must be defined.
icon:exclamation-triangle[] icon:eye-slash[]
-->
<snapshotUrl>{deployer_snapshot_url}</snapshotUrl>
<!--
Closes the staging repository.
Defaults to `false`.
Expand Down Expand Up @@ -151,6 +176,12 @@ Gradle::
----
include::partial$deploy/maven/gradle/common-head.adoc[]
// URL where the {deployer_name} snapshots are enabled.
// If left unspecified, the `JRELEASER_{prefix}_${name}_SNAPSHOT_URL`
// environment variable must be defined.
// icon:exclamation-triangle[] icon:eye-slash[]
snapshotUrl = '{deployer_snapshot_url}'
// Closes the staging repository.
// Defaults to `false`.
// icon:dot-circle[]
Expand Down Expand Up @@ -185,6 +216,16 @@ The name of the environment variable will be `JRELEASER_{prefix}_NAME_URL`. If y
you can store the host in the environment variable `JRELEASER_{prefix}_PRODUCTION_URL`. The name will be
transformed to uppercase.

== SnapshotUrl

You may set the snapshot url in the configuration as shown above, or you can have it read from an environment variable.
The configured name of the {deployer_name} instance will be used to build the environment variable name.
This means that the name per configured instance needs to be unique.

The name of the environment variable will be `JRELEASER_{prefix}_NAME_SNAPSHOT_URL`. If your instance is named `foo`,
you can store the host in the environment variable `JRELEASER_{prefix}_FOO_SNAPSHOT_URL`. The name will be
transformed to uppercase.

== Username

The configured username needs to be authenticated against the {deployer_name} instance.
Expand Down Expand Up @@ -238,7 +279,7 @@ TOML::
----
[deploy.maven.{deployer_id}.app]
active = "ALWAYS"
host = "{deployer_url}"
url = "{deployer_url}"
closeRepository = true
releaseRepository = true
stagingRepositories = ["target/staging-deploy"]
Expand All @@ -257,7 +298,7 @@ JSON::
"{deployer_id}": {
"app": {
"active": "ALWAYS",
"host": "{deployer_url}",
"url": "{deployer_url}",
"closeRepository": true,
"releaseRepository": true,
"stagingRepositories": [
Expand All @@ -283,7 +324,7 @@ Maven::
<{deployer_id}>
<app>
<active>ALWAYS</active>
<host>{deployer_url}</host>
<url>{deployer_url}</url>
<closeRepository>true</closeRepository>
<releaseRepository>true</releaseRepository>
<stagingRepositories>target/staging-deploy</stagingRepositories>
Expand All @@ -306,7 +347,7 @@ jreleaser {
{deployer_id} {
app {
active = 'ALWAYS'
host = '{deployer_url}'
url = '{deployer_url}'
closeRepository = true
releaseRepository = true
stagingRepository('target/staging-deploy')
Expand Down
11 changes: 6 additions & 5 deletions docs/modules/configuration/pages/environment.adoc
Expand Up @@ -803,14 +803,15 @@ The following key/values may be defined as properties or as environment variable
| JRELEASER_MATTERMOST_WEBHOOK | the webhook URL
|===

=== NExus2
=== Nexus2

[%header, cols="<1,<1", width="100%"]
|===
| Key | Description
| JRELEASER_NEXUS2_${NAME}_HOST | host matching the named Nexus2 instance
| JRELEASER_NEXUS2_${NAME}_USERNAME | a username matching the named Nexus2 instance
| JRELEASER_NEXUS2_${NAME}_PASSWORD | a password/token matching the named Nexus2 instance
| Key | Description
| JRELEASER_NEXUS2_${NAME}_URL | url matching the named Nexus2 instance (release)
| JRELEASER_NEXUS2_${NAME}_SNAPSHOT_URL | url matching the named Nexus2 instance (snapshots)
| JRELEASER_NEXUS2_${NAME}_USERNAME | a username matching the named Nexus2 instance
| JRELEASER_NEXUS2_${NAME}_PASSWORD | a password/token matching the named Nexus2 instance
|===

=== S3
Expand Down
5 changes: 1 addition & 4 deletions docs/modules/examples/pages/maven/maven-central.adoc
Expand Up @@ -160,7 +160,4 @@ file:
- `JRELEASER_GPG_PUBLIC_KEY`
- `JRELEASER_GPG_SECRET_KEY`
- `JRELEASER_GPG_PASSPHRASE`
- `JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD`
- `JRELEASER_NEXUS2_USERNAME`
WARNING: Publication of snapshots is *not* allowed.
- `JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD` or `JRELEASER_NEXUS2_USERNAME`

0 comments on commit e417ee9

Please sign in to comment.