---
schema_version: "1"
id: b645e05ebf6192807fd00dcdf7b5ef4a9837d1bc6fb348be469d7bbd213ba332
title: Deploying Mule Apps to Runtime Fabric using Maven
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/runtime-fabric/2.8/deploy-maven-4.x.md
canonical_url: https://docs.mulesoft.com/runtime-fabric/2.8/deploy-maven-4.x
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2b13e03bc0068cb458511f7542f387e2a86925320331145df22eb2860a7f08f6
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
---
product: Runtime Fabric
version: 2.8
---

# Deploying Mule Apps to Runtime Fabric using Maven

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

Runtime Fabric supports using Mule Maven Plugin 3.x to manage and deploy Mule applications. The
information in this topic is specific to deploying a Mule application to Mule runtime engine 4.x.

## Prerequisites

- 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.

- You understand and have available the number of resources required to deploy to Runtime Fabric  
  See [Resource Allocation on Anypoint Runtime Fabric](https://docs.mulesoft.com/runtime-fabric/latest/deploy-resource-allocation-self-managed)
  for more information.

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

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

If you publish assets using Exchange API, use Exchange API v2, otherwise schedulers aren’t
displayed.

## Add the Mule Maven Plugin to a Mule Project

To add the Mule Maven plugin, you need to add its maven dependency to the project:

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.7.1</version>
  <extensions>true</extensions>
</plugin>
```

From this repository:

```xml
<pluginRepositories>
  <pluginRepository>
    <id>mule-public</id>
    <url>https://repository.mulesoft.org/nexus/content/repositories/releases</url>
  </pluginRepository>
</pluginRepositories>
```

This enables the Mule Maven plugin in your project.

> [!IMPORTANT] If `<extensions>true</extensions>` is not present, the plugin does not work.

## Configure the Runtime Fabric Deployment Strategy

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

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.7.1</version>
  <extensions>true</extensions>
  <configuration>
    <runtimeFabricDeployment>
      <uri>https://anypoint.mulesoft.com</uri>
      <muleVersion>4.3.0</muleVersion>
      <username>user</username>
      <password>pass</password>
      <applicationName>newapp</applicationName>
      <target>rtf</target>
      <environment>Sandbox</environment>
      <provider>MC</provider>
      <replicas>1</replicas>
      <properties>
        <key>value</key>
      </properties>
      <deploymentSettings>
        <enforceDeployingReplicasAcrossNodes>false</enforceDeployingReplicasAcrossNodes>
        <updateStrategy>recreate</updateStrategy>
        <clustered>false</clustered>
        <forwardSslSession>false</forwardSslSession>
        <lastMileSecurity>false</lastMileSecurity>
        <resources>
          <cpu>
            <reserved>20m</reserved>
            <limit>1500m</limit>
          </cpu>
          <memory>
            <reserved>700Mi</reserved>
          </memory>
        </resources>
        <http>
          <inbound>
            <publicUrl>url</publicUrl>
          </inbound>
        </http>
      </deploymentSettings>
    </runtimeFabricDeployment>
  </configuration>
</plugin>
```

## Deploy to Runtime Fabric

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

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

### Exchange Snapshot Assets

You can also deploy Exchange snapshot assets into Runtime Fabric.

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 Runtime Fabric 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 Runtime Fabric

To redeploy the application, run the same command as you did to deploy.  
Runtime Fabric 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 Runtime Fabric 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
[Runtime Fabric Deployment Parameters Reference](#rtf-deploy-reference).

## Runtime Fabric 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>runtimeFabricDeployment</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 Runtime Fabric 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 choose 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.</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>target</code></p></div></div></td><td><div><div><p>The Runtime Fabric target name where to deploy the app.</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 Runtime Fabric.</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. The maximum number of replicas per application is 16.</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>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></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 Runtime Fabric 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></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></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>.</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>resources</code></p></div></div></td><td><div><table><colgroup><col> <col> <col></colgroup><tbody><tr><td rowspan="2"><p><code>cpu</code></p></td><td><p><code>reserved</code></p></td><td><p>Specifies the number of cores to allocate for each application replica. The default value is 0.5 vCores.</p></td></tr><tr><td><p><code>limit</code></p></td><td><p>Specifies the number of max cores to allocate for each replica of the application.<br>If a <code>reserved</code> configuration is present, ensure that this value is equal or higher.</p></td></tr><tr><td rowspan="2"><p><code>memory</code></p></td><td><p><code>reserved</code></p></td><td><p>Specifies the amount of memory to allocate for each application replica. The default value is 700 MB.</p></td></tr><tr><td><p><code>limit</code></p></td><td><p>Specifies the maximum memory allocated per application replica. If a <code>reserved</code> configuration is present, ensure that this value is equal or higher.</p></td></tr></tbody></table><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;resources&gt;
    &lt;cpu&gt;
      &lt;reserved&gt;20m&lt;/reserved&gt;
      &lt;limit&gt;1500m&lt;/limit&gt;
    &lt;/cpu&gt;
    &lt;memory&gt;
      &lt;reserved&gt;700Mi&lt;/reserved&gt;
    &lt;/memory&gt;
  &lt;/resources&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="2"><p><code>inbound</code></p></td><td><p><code>publicUrl</code></p></td><td><p>URL of the deployed application.</p></td></tr></tbody></table><div><p>Configuration example using wildcard URL:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;http&gt;
    &lt;inbound&gt;
      &lt;publicUrl&gt;https://myapp.example.com&lt;/publicUrl&gt;
    &lt;/inbound&gt;
  &lt;/http&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div><div><p>Configuration example for path-based routing:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;http&gt;
    &lt;inbound&gt;
      &lt;publicUrl&gt;https://www.example.com/myapp&lt;/publicUrl&gt;
    &lt;/inbound&gt;
  &lt;/http&gt;
&lt;/deploymentSettings&gt;</code></pre></div></div></div></td></tr><tr><td><div><div><p><code>persistentObjectStore</code></p></div></div></td><td><div><div><p>Configures the Mule application to use a persistent object store. By default, it is set to <code>false</code>.</p></div></div></td></tr><tr><td><div><div><p><code>jvm</code></p></div></div></td><td><div><table><colgroup><col> <col></colgroup><tbody><tr><td><p><code>args</code></p></td><td><p>Specifies JVM arguments to pass to Runtime Fabric when deploying the application. Use spaces to separate each argument.</p></td></tr></tbody></table><div><p>Configuration example:</p></div><div><div><pre><code data-lang="xml">&lt;deploymentSettings&gt;
  &lt;jvm&gt;
    &lt;args&gt;
      -XX:MaxMetaspaceSize=500m -XX:MaxRAMPercentage=60.0
    &lt;/args&gt;
  &lt;/jvm&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>Not applicable for Runtime Fabric BYOK. By default, it is set to <code>false</code></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. By default, it is set to <code>false</code>.</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></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>
        ...
        <runtimeFabricDeployment>
          ...
          <server>my.anypoint.credentials</server>
          ...
        </runtimeFabricDeployment>
        ...
      </configuration>
      ...
    <plugin>
    ```

    > [!NOTE] Make sure that the username and password are not 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)
