|
| 1 | +--- |
| 2 | +title: Deployment of artifacts with HTTP(S) |
| 3 | +author: |
| 4 | + - Konrad Windszus |
| 5 | +date: 2025-09-17 |
| 6 | +--- |
| 7 | + |
| 8 | +<!-- Licensed to the Apache Software Foundation (ASF) under one--> |
| 9 | +<!-- or more contributor license agreements. See the NOTICE file--> |
| 10 | +<!-- distributed with this work for additional information--> |
| 11 | +<!-- regarding copyright ownership. The ASF licenses this file--> |
| 12 | +<!-- to you under the Apache License, Version 2.0 (the--> |
| 13 | +<!-- "License"); you may not use this file except in compliance--> |
| 14 | +<!-- with the License. You may obtain a copy of the License at--> |
| 15 | +<!----> |
| 16 | +<!-- http://www.apache.org/licenses/LICENSE-2.0--> |
| 17 | +<!----> |
| 18 | +<!-- Unless required by applicable law or agreed to in writing,--> |
| 19 | +<!-- software distributed under the License is distributed on an--> |
| 20 | +<!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY--> |
| 21 | +<!-- KIND, either express or implied. See the License for the--> |
| 22 | +<!-- specific language governing permissions and limitations--> |
| 23 | +<!-- under the License.--> |
| 24 | + |
| 25 | +# Deployment of artifacts with HTTP(S) |
| 26 | + |
| 27 | +In order to deploy artifacts using HTTP(S) you must specify the use of an HTTP(S) server in the [**distributionManagement** element of your POM](https://maven.apache.org/pom.html#Distribution_Management): |
| 28 | + |
| 29 | +```unknown |
| 30 | +<project> |
| 31 | + ... |
| 32 | + <distributionManagement> |
| 33 | + <repository> |
| 34 | + <id>my-mrm-relases</id> |
| 35 | + <url>http://localhost:8081/nexus/content/repositories/release</url> |
| 36 | + </repository> |
| 37 | + </distributionManagement> |
| 38 | + ... |
| 39 | +</project> |
| 40 | +``` |
| 41 | + |
| 42 | +## Authentication |
| 43 | + |
| 44 | +Your `settings.xml` would contain a `server` element where the `id` of that element matches `id` of the HTTP(S) repository specified in the POM above. It must contain the credentials to be used (in [encrypted form](https://maven.apache.org/guides/mini/guide-encryption.html)): |
| 45 | + |
| 46 | +```unknown |
| 47 | +<settings> |
| 48 | + ... |
| 49 | + <servers> |
| 50 | + <server> |
| 51 | + <id>my-mrm-releases</id> |
| 52 | + <username><my-encrypted-user></username> |
| 53 | + <password><my-encrypted-password></password> |
| 54 | + </server> |
| 55 | + </servers> |
| 56 | + ... |
| 57 | +</settings> |
| 58 | +``` |
| 59 | + |
| 60 | +Further details in [Security and Deployment Settings](https://maven.apache.org/guides/mini/guide-deployment-security-settings.html). |
| 61 | + |
| 62 | +## HTTP method |
| 63 | + |
| 64 | +Deployment leverages one *HTTP PUT* request per artifact/checksum/metadata (optionally using HTTP Basic Authentication) with no query parameters. Make sure your used [Maven repository manager](https://maven.apache.org/repository-management.html) supports this method of deployment, otherwise this plugin cannot be used. |
| 65 | + |
| 66 | +*[Sonatype Central Portal](https://maven.apache.org/repository/guide-central-repository-upload.html) only supports this via the legacy [Portal OSSRH Staging API](https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/) for release versions. [SNAPSHOT version](https://central.sonatype.org/publish/publish-portal-snapshots/) deployments for Central Portal are still supported with `maven-deploy-plugin`*. |
| 67 | + |
| 68 | +## HTTP client settings |
| 69 | + |
| 70 | +The HTTP client being used by default depends on the underlying Maven version as the [Maven Resolver Transport](https://maven.apache.org/guides/mini/guide-resolver-transport.html) is leveraged for the actual deployment. One can override that default client with Maven user property `maven.resolver.transport`. Maven Resolver also evaluates other advanced [configuration properties](https://maven.apache.org/resolver-archives/resolver-LATEST-1.x/configuration.html) which can be set as Maven user properties. However, in most of the cases the defaults should work fine. |
0 commit comments