---
schema_version: "1"
id: dccdeba496b5d76219bf643c858726738f8eb65f780d2b6cb6952d06e22a69f5
title: Deploy Applications to CloudHub 2.0 Using the Mule Maven Plugin
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/latest/deploy-to-cloudhub-2.md
canonical_url: https://docs.mulesoft.com/mule-runtime/latest/deploy-to-cloudhub-2
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9da3af04ac4ab715d7f629196f443390a4b83c7c5aab05f8af857b9ce585b36e
description: MuleSoft Documentation Site
release: "4.13"
latest: true
---
---
product: Mule Runtime
version: 4.13
is-latest-version: true
---

# Deploy Applications to CloudHub 2.0 Using the Mule Maven Plugin

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

> [!WARNING] Mule Maven plugin versions 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6,
> 3.1.7, and 3.8.3 are deprecated.

> [!NOTE] Where possible, we changed noninclusive terms to align with our company value of Equality.
> We maintained certain terms to avoid any effect on customer implementations.

In addition to using Anypoint Runtime Manager, to deploy applications to CloudHub 2.0, you can also
deploy applications by using the Mule Maven plugin. To do so, you must meet certain prerequisites,
and configure your CloudHub 2.0 deployment strategy in your project’s `pom.xml` file.

## Before You Begin

- Ensure that the Mule Maven Plugin is added to your project

  See [Add the Mule Maven Plugin to a Mule Project](https://docs.mulesoft.com/mule-runtime/latest/mmp-concept#add-mmp) for instructions.

- The application is already published in Exchange

  See [Publish and Deploy Exchange Assets Using Maven](https://docs.mulesoft.com/exchange/to-publish-assets-maven).

- The Mule Maven Facade API (v3) is added as a repository in the distribution management section of
  your project’s POM file. For example:

  ```xml
    <distributionManagement>
      <repository>
        <id>Repository</id>
        <name>Corporate Repository</name>
        <url>https://maven.anypoint.mulesoft.com/api/v3/organizations/ORGANIZATION_ID/maven</url>
        <layout>default</layout>
      </repository>
    </distributionManagement>
  ```

  See
  [The Mule Maven Facade API documentation](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/exchange-maven-facade-api-http/)
  for more information.

## Configure the CloudHub 2.0 Deployment Strategy

Inside the `plugin` element, add a configuration for your CloudHub 2.0 deployment, replacing the
following placeholder values with your CloudHub 2.0 information:

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.7.1</version>
  <extensions>true</extensions>
  <configuration>
    <cloudhub2Deployment>
      <uri>https://anypoint.mulesoft.com</uri>
      <provider>MC</provider>
      <environment>${environment}</environment>
      <target>${targetName}</target>
      <muleVersion>${muleVersion}</muleVersion>
      <username>${user}</username>
      <password>${pass}</password>
      <applicationName>${appName}</applicationName>
      <replicas>1</replicas>
      <vCores>1</vCores>
      <deploymentSettings>
        <http>
          <inbound>
            <publicUrl>${publicUrl}</publicUrl>
            <forwardSslSession>true</forwardSslSession>
            <lastMileSecurity>true</lastMileSecurity>
          </inbound>
        </http>
      </deploymentSettings>
    </cloudhub2Deployment>
  </configuration>
</plugin>
```

## Deploy to CloudHub 2.0

From the command line in your project’s folder, package the application and execute the deploy goal:

```bash
mvn clean deploy -DmuleDeploy
```

To deploy the artifact without rebuilding it, run:

```bash
mvn mule:deploy
```

### Exchange Snapshot Assets

You can also deploy Exchange snapshot assets into CloudHub 2.0.

By using `SNAPSHOT` version assets in Anypoint Exchange during the development and testing phase,
you can avoid incrementing your application’s version number for small changes. After your
`SNAPSHOT` version application has been overwritten in Anypoint Exchange, you can redeploy your
`SNAPSHOT` version application to CloudHub 2.0 via the Mule Maven plugin to deploy the latest
changes.

To learn more about publishing snapshot assets to Anypoint Exchange, see
[Asset Lifecycle State](https://docs.mulesoft.com/exchange/to-publish-assets-maven#asset-lifecycle-state).

> [!NOTE] Each time you update your application’s snapshot, redeploy the application to refresh it
> with the latest snapshot binaries.
>
> Because snapshot assets can change after deployment, avoid deploying them into your production
> environment.

## Redeploy to CloudHub 2.0

To redeploy the application, run the same command as you did to deploy.  
CloudHub 2.0 rewrites the application you had deployed.

## Authentication Methods

When you deploy applications using Mule Maven plugin, you can use different methods to provide your
credentials to authenticate against the deployment platform. Depending on the authentication method
you use, the parameters to set in the deployment configuration differ:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Authentication Method</th><th>Description</th><th>Configuration Parameters</th></tr></thead><tbody><tr><td><div><div><p>Username and password</p></div></div></td><td><div><div><p>Use a CloudHub 2.0 username and password to authenticate.</p></div></div></td><td><div><div><ul><li><p><code>username</code><br></p></li><li><p><code>password</code></p></li></ul></div></div></td></tr><tr><td><div><div><p>Server</p></div></div></td><td><div><div><p>Use credentials stored in a Maven server, configured inside the Maven <code>settings.xml</code> file.</p></div></div></td><td><div><div><ul><li><p><code>server</code></p></li></ul></div></div></td></tr><tr><td><div><div><p>Authorization Token</p></div></div></td><td><div><div><p>Use an authorization token to access the platform.<br>See <a href="https://docs.mulesoft.com/access-management/external-identity">Identity Management</a> for a list of supported single sign-on (SSO) types.</p></div></div></td><td><div><div><ul><li><p><code>authToken</code></p></li></ul></div></div></td></tr><tr><td><div><div><p>Connected Apps</p></div></div></td><td><div><div><p>Use a Connected App to perform the authentication programmatically by communicating with Anypoint Platform.<br>Note that the Connected App credentials must have the <code>Design Center Developer</code> access scope.<br>See <a href="https://docs.mulesoft.com/access-management/connected-apps-developers">Connected Apps for Developers</a> for instructions about creating Connected Apps.</p></div></div></td><td><div><div><ul><li><p><code>connectedAppClientId</code><br></p></li><li><p><code>connectedAppClientSecret</code><br></p></li><li><p><code>connectedAppGrantType</code></p></li></ul></div></div></td></tr></tbody></table>

For a detailed description of the configuration parameters, see the
[CloudHub 2.0 Deployment Parameters Reference](#cloudhub2-deploy-reference).

## CloudHub 2.0 Deployment Parameters Reference

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Parameter</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><div><div><p><code>cloudhub2Deployment</code></p></div></div></td><td><div><div><p>Top-Level Element</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>uri</code></p></div></div></td><td><div><div><p>Your Anypoint Platform URI.<br>If not set, defaults to https://anypoint.mulesoft.com.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>muleVersion</code></p></div></div></td><td><div><div><p>The Mule runtime engine version to run in your CloudHub 2.0 instance.<br>Ensure that this value is equal to or higher than the earliest required Mule version of your application. By default, the latest available Mule version is selected.<br>Example values: <code>4.6.0</code> selects the last build where it defaults to Edge channel and Java 8. If you want to select a different LTS or Edge selection or Java version, specify the full Mule version name as in <code>4.6.0:1e-java17</code>.<br>When using Mule Maven plugin versions 3.8.0 and 4.0.0 for deployments, the <code>muleVersion</code> property doesn’t allow you to specify <code>releaseChannel</code> and <code>javaVersion</code>. To specify these properties, upgrade the plugin to version 4.1.1 or later.<br>Because Mule runtime 4.4 Standard Support ends in October 2024, new Mule apps can be deployed on either Mule 4.6 LTS or Mule 4.8 Edge. As LTS channel isn’t supported for customers using a Mule Maven plugin version 4.1.0 or earlier, upgrade the plugin to version 4.1.1 or later.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>releaseChannel</code></p></div></div></td><td><div><div><p>Set the name of the release channel used to select the Mule image. Supported values are <code>NONE</code>, <code>EDGE</code>, and <code>LTS</code>. By default, the value is set to <code>EDGE</code>. If the selected release channel doesn’t exist, an error occurs.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>javaVersion</code></p></div></div></td><td><div><div><p>Set the Java version used in the deploy. Supported values are <code>8</code> and <code>17</code>. By default, the value is set to <code>8</code>. If the selected Java version doesn’t exist, an error occurs.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>username</code></p></div></div></td><td><div><div><p>Your Anypoint Platform username</p></div></div></td><td><div><div><p>Only when using Anypoint Platform credentials to login.</p></div></div></td></tr><tr><td><div><div><p><code>password</code></p></div></div></td><td><div><div><p>Your Anypoint Platform password</p></div></div></td><td><div><div><p>Only when using Anypoint Platform credentials to login.</p></div></div></td></tr><tr><td><div><div><p><code>applicationName</code></p></div></div></td><td><div><div><p>The application name displayed in Runtime Manager after the app deploys.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>scopeLoggingConfigurations</code></p></div></div></td><td><div><table><colgroup><col> <col> <col></colgroup><tbody><tr><td rowspan="2"><p><code>scopeLoggingConfiguration</code></p></td><td><p><code>scope</code></p></td><td><p>The package of the logging library to use.</p></td></tr><tr><td><p><code>logLevel</code></p></td><td><p>The log level. Accepted values: <code>INFO</code>, <code>DEBUG</code>, <code>WARN</code>, <code>ERROR</code>, <code>FATAL</code>.</p></td></tr></tbody></table><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;scopeLoggingConfigurations&gt;
  &lt;scopeLoggingConfiguration&gt;
    &lt;scope&gt;com.pkg.warning&lt;/scope&gt;
    &lt;logLevel&gt;WARN&lt;/logLevel&gt;
  &lt;/scopeLoggingConfiguration&gt;
  &lt;scopeLoggingConfiguration&gt;
    &lt;scope&gt;com.pkg.debug&lt;/scope&gt;
    &lt;logLevel&gt;DEBUG&lt;/logLevel&gt;
  &lt;/scopeLoggingConfiguration&gt;
&lt;/scopeLoggingConfigurations&gt;</code></pre></div></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>target</code></p></div></div></td><td><div><div><p>The CloudHub 2.0 target name to deploy the app to.<br>Specify either a shared space or a private space available in your Deployment Target values in CloudHub 2.0. See <a href="https://docs.mulesoft.com/cloudhub-2/ch2-features">Features of CloudHub 2.0</a> for a detailed description on shared and private spaces. Use a target name value from the <a href="https://docs.mulesoft.com/cloudhub-2/ch2-architecture#regions-and-dns-records">list of regions</a>. For example, <code>Cloudhub-US-East-1</code>.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>provider</code></p></div></div></td><td><div><div><p>Provider MC (MuleSoft Control Plane) indicates that the deployment is managed through Anypoint Runtime Manager. Set to <code>MC</code> for CloudHub 2.0.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>environment</code></p></div></div></td><td><div><div><p>Target Anypoint Platform environment.<br>This value must match an environment configured in your Anypoint Platform account, as shown here:<br></p></div><div><div><pre><code data-lang="xml">&lt;environment&gt;Sandbox&lt;/environment&gt;</code></pre></div></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>replicas</code></p></div></div></td><td><div><div><p>Specifies the number of replicas, or instances, of the Mule application to deploy.</p></div></div></td><td><div><div><p>Only when <code>autoscaling</code> is set to <code>false</code>.</p></div></div></td></tr><tr><td><div><div><p><code>vCores</code></p></div></div></td><td><div><div><p>The size of each replica specified in vCores. Accepted values: <code>0.1</code>, <code>0.2</code>, <code>0.5</code>, <code>1</code>, <code>1.5</code>, <code>2</code>, <code>2.5</code>, <code>3</code>, <code>3.5</code>, <code>4</code>. See <a href="https://docs.mulesoft.com/cloudhub-2/ch2-architecture#cloudhub-2-replicas">CloudHub 2.0 Replicas</a> for a detailed description of available vCore sizes and their assigned hardware resources.<br>This parameter cannot be used if you configure <code>instanceType</code>.</p></div></div></td><td><div><div><p>Yes (Only when <code>instanceType</code> isn’t configured.)</p></div></div></td></tr><tr><td><div><div><p><code>businessGroup</code></p></div></div></td><td><div><div><p>The Business group path of the deployment<br>Specify the full hierarchical path from the parent organization to the target Business group, for example:</p></div><div><div><pre><code data-lang="xml">&lt;businessGroup&gt;ParentOrg\SubOrg1\myBusinessGroup&lt;/businessGroup&gt;</code></pre></div></div><div><p>This value is omitted if <code>businessGroupId</code> is set. If <code>businessGroup</code> and <code>businessGroupId</code> are not set, the value defaults to the main business group of the user.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>businessGroupId</code></p></div></div></td><td><div><div><p>The Business group ID of the deployment<br>Instead of specifying the Business group path, you can specify the Business group ID to deploy your application. If <code>businessGroupId</code> and <code>businessGroup</code> are not set, the value defaults to the main business group of the user.<br>The Business group ID is a mandatory parameter when you have access only to a specific Business group but not to the parent organization.<br>This parameter is available in plugin version 3.2.7 and later.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>deploymentTimeout</code></p></div></div></td><td><div><div><p>The allowed elapsed time, in milliseconds, between the start of the deployment process and the confirmation that the artifact has been deployed</p></div><div><p>The default value is <code>600000</code>.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>server</code></p></div></div></td><td><div><div><p>Maven server with Anypoint Platform credentials<br>This is only needed if you want to use your credentials stored in your Maven <code>settings.xml</code> file. This is not the Mule server name.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>properties</code></p></div></div></td><td><div><div><p>Top-Level element<br>If you need to set properties for the Mule application you are deploying, you can use the <code>&lt;properties&gt;</code> top-level element:</p></div><div><div><pre><code data-lang="xml">&lt;properties&gt;
  &lt;key&gt;value&lt;/key&gt;
&lt;/properties&gt;</code></pre></div></div><div><p>For example:</p></div><div><div><pre><code data-lang="xml">&lt;properties&gt;
  &lt;http.port&gt;8081&lt;/http.port&gt;
&lt;/properties&gt;</code></pre></div></div><div><p>If you redeploy the application and neither the <code>properties</code> nor the <code>secureProperties</code> element is configured in the deployment POM file, CloudHub 2.0 preserves the existing properties configured in your CloudHub 2.0 environment. If either element is present, CloudHub 2.0 deploys the application using only the properties and secure properties defined in the POM. It doesn’t merge them with values configured in Runtime Manager. Any existing properties that aren’t included in the deployment configuration are removed. To keep existing values, omit both elements, or send the full set of properties and secure properties on every redeploy.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>propertiesFile</code></p></div></div></td><td><div><div><p>Top-level element<br>Specifies a file that contains properties for the Mule application being deployed. Use this parameter as an alternative to defining properties inline with <code>&lt;properties&gt;</code>. The file must use the Java properties format, with one <code>key=value</code> pair per line.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>secureProperties</code></p></div></div></td><td><div><div><p>Top-Level element<br>Use the <code>secureProperties</code> top-level element to set properties for the Mule application and instruct CloudHub 2.0 to encrypt the values before storing them:</p></div><div><div><pre><code data-lang="xml">&lt;secureProperties&gt;
  &lt;key&gt;value&lt;/key&gt;
&lt;/secureProperties&gt;</code></pre></div></div><div><p>For example:</p></div><div><div><pre><code data-lang="xml">&lt;secureProperties&gt;
  &lt;http.port&gt;8081&lt;/http.port&gt;
&lt;/secureProperties&gt;</code></pre></div></div><div><p>If you redeploy the application and neither the <code>secureProperties</code> nor the <code>properties</code> element is configured in the deployment POM file, CloudHub 2.0 preserves the existing secure properties configured in your CloudHub 2.0 environment. If either element is present, CloudHub 2.0 deploys the application using only the properties and secure properties defined in the POM. It doesn’t merge them with values configured in Runtime Manager. Any existing secure properties that aren’t included in the deployment configuration are removed. To keep existing values, omit both elements, or send the full set of properties and secure properties on every redeploy.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>skip</code></p></div></div></td><td><div><div><p>When set to <code>true</code>, skips the plugin deployment goal.<br>Its default value is <code>false</code>.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>skipDeploymentVerification</code></p></div></div></td><td><div><div><p>When set to <code>true</code>, skips the status verification of your deployed app.<br>Its default value is <code>false</code>.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>authToken</code></p></div></div></td><td><div><div><p>Specifies the authorization token to access the platform. You can use this authentication method instead of setting username and password.<br>See <a href="https://docs.mulesoft.com/access-management/external-identity">Identity Management</a> for a list of supported single sign-on (SSO) types.</p></div></div></td><td><div><div><p>Only when using an Authorization token to login.</p></div></div></td></tr><tr><td><div><div><p><code>connectedAppClientId</code></p></div></div></td><td><div><div><p>Specifies the Connected App <code>clientID</code> value.</p></div></div></td><td><div><div><p>Only when using Connected Apps credentials to login.</p></div></div></td></tr><tr><td><div><div><p><code>connectedAppClientSecret</code></p></div></div></td><td><div><div><p>Specifies the Connected App secret key.</p></div></div></td><td><div><div><p>Only when using Connected Apps credentials to login.</p></div></div></td></tr><tr><td><div><div><p><code>connectedAppGrantType</code></p></div></div></td><td><div><div><p>Specifies the only supported connection type: <code>client_credentials</code>.</p></div></div></td><td><div><div><p>Only when using Connected Apps credentials to login.</p></div></div></td></tr><tr><td><div><div><p><code>deploymentSettings</code></p></div></div></td><td><div><div><p>Any of the parameters documented in <a href="#deployment-settings">deploymentSettings Reference</a>.</p></div></div></td><td><div><div><p>No</p></div></div></td></tr><tr><td><div><div><p><code>integrations</code></p></div></div></td><td><div><table><colgroup><col> <col> <col> <col></colgroup><tbody><tr><td><p><code>services</code></p></td><td><p><code>objectStoreV2</code></p></td><td><p><code>enabled</code></p></td><td><p>When set to <code>true</code>, instructs the deployment to use Object Store v2.</p></td></tr></tbody></table><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;integrations&gt;
  &lt;services&gt;
    &lt;objectStoreV2&gt;
      &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;/objectStoreV2&gt;
  &lt;/services&gt;
&lt;/integrations&gt;</code></pre></div></div></div></td><td><div><div><p>No</p></div></div></td></tr></tbody></table>

### deploymentSettings Parameters Reference

<table><colgroup><col> <col></colgroup><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>enforceDeployingReplicasAcrossNodes</code></p></div></div></td><td><div><div><p>Enforces the deployment of replicas across different nodes. The default value is <code>false</code>.<br>For high availability, set this value to <code>true</code>.</p></div><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;enforceDeployingReplicasAcrossNodes&gt;false&lt;/enforceDeployingReplicasAcrossNodes&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>updateStrategy</code></p></div></div></td><td><div><table><colgroup><col> <col></colgroup><thead><tr><th>Accepted values</th><th>Description</th></tr></thead><tbody><tr><td><p><code>rolling</code></p></td><td><p>Maintains availability by updating replicas incrementally. Requires one additional replica’s worth of resources to succeed.<br>If <code>enforceDeployingReplicasAcrossNodes</code> is enabled, the maximum number of replicas you can configure is one less than the total number of nodes.</p></td></tr><tr><td><p><code>recreate</code></p></td><td><p>Terminates replicas before re-deployment. Re-deployment is quicker than <code>rolling</code> and doesn’t require additional resources.<br>If <code>enforceDeployingReplicasAcrossNodes</code> is enabled, the maximum number of replicas you can configure is equal to the number of nodes.</p></td></tr></tbody></table><div><p>The default value is <code>rolling</code>.</p></div><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;updateStrategy&gt;recreate&lt;/updateStrategy&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>clustered</code></p></div></div></td><td><div><div><p>Enables clustering across two or more replicas of the application. The default value is <code>false</code>.<br></p></div><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
    &lt;clustered&gt;true&lt;/clustered&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>http</code></p></div></div></td><td><div><table><colgroup><col> <col> <col></colgroup><tbody><tr><td rowspan="5"><p><code>inbound</code></p></td><td><p><code>publicUrl</code></p></td><td><p>URL of the deployed application. You can add multiple comma-separated values.</p></td></tr><tr><td><p><code>endpoint</code></p></td><td><p>Defines application endpoints by specifying the <code>url</code>, <code>pathRewrite</code>, and <code>access</code> attributes. Accepted values for <code>access</code> are <code>internal</code> and <code>external</code>.</p></td></tr><tr><td><p><code>pathRewrite</code></p></td><td><p>Supplies the base path expected by the HTTP listener in your application. This value must begin with <code>/</code>. This parameter is used only for applications that are deployed to <a href="https://docs.mulesoft.com/cloudhub-2/ch2-private-space-about">private space</a>.</p></td></tr><tr><td><p><code>lastMileSecurity</code></p></td><td><p>Enable Last-Mile security to perform TLS termination and decryption for forwarded HTTPS connections directly within the Mule application. This requires the Mule application to include an SSL certificate and consumes additional CPU resources. The default value is <code>false</code>.</p></td></tr><tr><td><p><code>forwardSslSession</code></p></td><td><p>Enables SSL forwarding during a session. The default value is <code>false</code>.</p></td></tr></tbody></table><div><div data-type="NOTE"><div><p>Mule Maven Plugin supports both <code>publicUrl</code> and <code>endpoint</code> for configuring application endpoints. Configure either <code>publicUrl</code> or <code>endpoints</code>, but not both in the same deployment configuration.</p></div></div></div><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;http&gt;
    &lt;inbound&gt;
      &lt;publicUrl&gt;https://myapp.anypoint.com&lt;/publicUrl&gt;
      &lt;pathRewrite&gt;/api&lt;/pathRewrite&gt;
      &lt;lastMileSecurity&gt;true&lt;/lastMileSecurity&gt;
      &lt;forwardSslSession&gt;true&lt;/forwardSslSession&gt;
    &lt;/inbound&gt;
  &lt;/http&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div><div><p>Example using <code>endpoint</code>:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;http&gt;
    &lt;inbound&gt;
      &lt;endpoints&gt;
        &lt;endpoint&gt;
          &lt;url&gt;https://test1.com/ch2testapp1&lt;/url&gt;
          &lt;pathRewrite&gt;/&lt;/pathRewrite&gt;
          &lt;access&gt;external&lt;/access&gt;
        &lt;/endpoint&gt;
      &lt;/endpoints&gt;
    &lt;/inbound&gt;
  &lt;/http&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>generateDefaultPublicUrl</code></p></div></div></td><td><div><div><p>When set to <code>true</code>, CloudHub 2.0 generates a public URL for the deployed application.<br>This parameter is used only for applications that are deployed to <a href="https://docs.mulesoft.com/cloudhub-2/ch2-private-space-about">private space</a>. Applications that are deployed to <a href="https://docs.mulesoft.com/cloudhub-2/ch2-shared-space-about">shared space</a> always get a generated public URL.</p></div></div></td></tr><tr><td><div><div><p><code>disableAmLogForwarding</code></p></div></div></td><td><div><div><p>Disables the application-level log forwarding to Anypoint Monitoring. The default value is <code>false</code>.</p></div></div></td></tr><tr><td><div><div><p><code>tracingEnabled</code></p></div></div></td><td><div><div><p>Exposes tracing information in OpenTelemetry standard from Mule runtime into all APM solutions. See <a href="https://docs.mulesoft.com/cloudhub-2/ch2-deploy-private-space#enable-trace-data-collection">Enable Trace Data Collection</a>.</p></div></div></td></tr><tr><td><div><div><p><code>autoscaling</code></p></div></div></td><td><div><div><p>Provides CPU based horizontal autoscaling configuration for deployment and redeployment operations. If autoscaling is disabled and the fields <code>minReplicas</code> and <code>maxReplicas</code> are provided, they must match the value of the <code>target.replicas</code> field. See <a href="https://docs.mulesoft.com/cloudhub-2/ch2-configure-horizontal-autoscaling">Enable Trace Data Collection</a>. Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;autoscaling&gt;
    &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;minReplicas&gt;1&lt;/minReplicas&gt;
    &lt;maxReplicas&gt;2&lt;/maxReplicas&gt;
  &lt;/autoscaling&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>instanceType</code></p></div></div></td><td><div><div><p>Specifies the capacity of the replica for application deployment. This flag is available only for organizations using a usage-based pricing (UBP) package. Non-UBP organizations use the <code>vCores</code> parameter instead. See <a href="https://docs.mulesoft.com/general/pricing">Anypoint Platform Pricing</a>.</p></div></div></td></tr></tbody></table>

## Encrypt Credentials

To use encrypted credentials when deploying, you need to set up your Maven master encrypted password
and your `settings-security.xml` file.

1.  Create a master password for your Maven configuration.

    mvn --encrypt-master-password <yourMasterPassword>

    Maven returns your master password encrypted:

    {l9vZ2uM5SdgHy+H12z4pX7LEOZn3Kbnqmt3kIquLjnQ=}

2.  Create a `settings-security.xml` file in your ~/.m2 repository and add your encrypted master
    password:

    ```xml
    <settingsSecurity>
      <master>{l9vZ2uM5SdgHy+H12z4pX7LEOZn3Kbnqmt3kIquLjnQ=}</master>
    </settingsSecurity>
    ```

3.  Encrypt your Anypoint platform password:

    mvn --encrypt-password <yourAnypointPlatformPassword>

    Maven returns your Anypoint platform password encrypted:

    {HTWFGH5BG9QmvJ1B=}

4.  Add your encrypted Anypoint Platform password to your `settings.xml` file in the <server>
    section:

    ```xml
    <settings>
     ...
      <servers>
       ...
        <server>
          <id>my.anypoint.credentials</id>
          <username>my.anypoint.username</username>
          <password>{HTWFGH5BG9QmvJ1B=}</password>
        </server>
       ...
      </servers>
     ...
    </settings>
    ```

5.  In your configuration deployment, reference the credentials injecting the server ID configured
    in your `settings.xml` file:

    ```xml
    <plugin>
      ...
      <configuration>
        ...
        <cloudhub2Deployment>
          ...
          <server>my.anypoint.credentials</server>
          ...
        </cloudhub2Deployment>
        ...
      </configuration>
      ...
    <plugin>
    ```

    > [!NOTE] Make sure that the username and password aren’t set in the deployment configuration,
    > or they will overwrite the defined server ID.

## See Also

- [Mule Maven Plugin](https://docs.mulesoft.com/mule-runtime/latest/mmp-concept)

- [CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/)
