Skip to content

Commit 1bd93c7

Browse files
committed
Example for HTTP(S) deployment
This closes #616
1 parent cdf3536 commit 1bd93c7

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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.

src/site/markdown/project-deployment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ date: 2006-07-14
2626

2727
Here are examples of using the deploy plugin for project deployment:
2828

29+
- [Deployment with HTTP(S)](./examples/deploy-http.html)
2930
- [Deployment with FTP](./examples/deploy-ftp.html)
3031
- [Deployment with external SSH](./examples/deploy-ssh-external.html)
3132
- [Workarounds when there are network issues](./examples/deploy-network-issues.html)

src/site/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ under the License.
4141
</menu>
4242
<menu name="Examples">
4343
<item name="Project Deployment" collapse="true" href="project-deployment.html">
44+
<item name="Deployment with HTTP(S)" href="examples/deploy-http.html" />
4445
<item name="Deployment with FTP" href="examples/deploy-ftp.html" />
4546
<item name="Deployment with external SSH" href="examples/deploy-ssh-external.html"/>
4647
<item name="Deploying With Network Issues" href="examples/deploy-network-issues.html"/>

0 commit comments

Comments
 (0)