Fork me on GitHub

Deployment of artifacts with HTTP(S)

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:

<project>
  ...
  <distributionManagement>
    <repository>
      <id>my-mrm-relases</id>
      <url>http://localhost:8081/nexus/content/repositories/release</url>
    </repository>
  </distributionManagement>
  ...
</project>

Authentication

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):

<settings>
  ...
  <servers>
    <server>
      <id>my-mrm-releases</id>
      <username><my-encrypted-user></username>
      <password><my-encrypted-password></password>
    </server>
  </servers>
  ...
</settings>

Further details in Security and Deployment Settings.

HTTP method

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 supports this method of deployment, otherwise this plugin cannot be used.

Sonatype Central Portal only supports this via the legacy Portal OSSRH Staging API for release versions. SNAPSHOT version deployments for Central Portal are still supported with maven-deploy-plugin.

HTTP client settings

The HTTP client being used by default depends on the underlying Maven version as the Maven Resolver Transport 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 which can be set as Maven user properties. However, in most of the cases the defaults should work fine.