---
schema_version: "1"
id: 73ae98ab547402b8f0ab525c2f1cf674520e6ca3af383115dbe7cd02703adb40
title: Deploy Applications to On-Premises Mule Instances Using the Mule Maven Plugin
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.3/deploy-on-premises.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.3/deploy-on-premises
source_site: docs.mulesoft.com
content_type: documentation
content_hash: fb99fce3258d33c499f0117187b28852e9e07fb0ee6d1d465b9a09de89d4dbd6
description: MuleSoft Documentation Site
release: "4.3"
latest: false
---
---
product: Mule Runtime
version: 4.3
---

# Deploy Applications to On-Premises Mule Instances 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 Studio, Anypoint Runtime Manager, or the Anypoint Platform CLI to
deploy applications on-premises, you can also deploy Mule applications by using the Mule Maven
plugin. To do so, you must meet certain prerequisites, and configure the desired deployment strategy
in your project’s `pom.xml` file.

If you want to deploy applications on-premises using a different method, see:

- [Deploy Applications On-Premises Using Runtime Manager](https://docs.mulesoft.com/runtime-manager/deploying-to-your-own-servers)

- [Deploy Applications On-Premises Using the Anypoint Platform CLI](https://docs.mulesoft.com/anypoint-cli/latest/standalone-apps#runtime-mgr-standalone-application-deploy)

- [Deploy Applications On-Premises Using Anypoint Studio](https://docs.mulesoft.com/studio/import-export-packages#export-project-studio)

## On-premises Deployment Strategies

When you deploy applications on-premises using the Mule Maven plugin, you can select three different
methods for deployment:

- Standalone deployment  
  By using this method you perform a manual deployment of your Mule application to your on-premises
  Mule instance.

- Runtime Manager REST API deployment  
  This method enables you to deploy an application using the Runtime Manager REST API, which links
  your on-premises Mule instance with your Anypoint Runtime Manager account, where you can do
  further management and monitoring of your deployed application.

- Runtime Manager Agent deployment  
  This method enables you to deploy an application using the Runtime Manager agent, which exposes a
  local API that you can call to manage and monitor your deployed application.

The Mule Maven plugin also supports deploying domains when using the standalone deployment strategy,
or the Runtime Manager agent deployment strategy.

Additional operations enable you to deploy applications in parallel and update applications at
runtime.

## Prerequisites

- Add the Mule Maven Plugin to your project

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

## Deploy a Mule Application to a Standalone Mule Runtime Engine

Inside the `plugin` element, add a configuration for your standalone deployment, replacing the
placeholder values with your local Mule runtime engine information:

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.4.2</version>
  <extensions>true</extensions>
  <configuration>
    <standaloneDeployment>
      <muleHome>${mule.home.test}</muleHome>
      <muleVersion>${app.runtime}</muleVersion>
    </standaloneDeployment>
  </configuration>
</plugin>
```

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

```console
mvn clean package deploy -DmuleDeploy
```

### Standalone 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>standaloneDeployment</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>applicationName</code></p></div></div></td><td><div><div><p>Specifies the application name to use during deployment.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>muleVersion</code></p></div></div></td><td><div><div><p>The Mule version running in your local machine instance.<br>If this value does not match the Mule version running in your deployment target, the plugin raises an exception.</p></div><div><p>The Mule Maven Plugin does not download a Mule runtime engine if these values don’t match.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>muleHome</code></p></div></div></td><td><div><div><p>The location of the Mule instance in your local machine.</p></div></div></td><td><div><div><p>Yes</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>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></tbody></table>

## Deploy a Mule Application Using the Runtime Manager REST API

Mule Maven plugin enables you to deploy a Mule Application to a local Mule instance using the
Runtime Manager REST API.

### Prerequisites

- You need a server, server group or cluster created in Runtime Manager.

  - To create a server, see [Add Servers](https://docs.mulesoft.com/runtime-manager/servers-create).

  - To create a server group, see [Create Server Groups](https://docs.mulesoft.com/runtime-manager/server-group-create).

  - To create a cluster, see [Create Clusters](https://docs.mulesoft.com/runtime-manager/cluster-create).

### Deploying Using the Runtime Manager REST API

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

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.4.2</version>
  <extensions>true</extensions>
  <configuration>
    <armDeployment>
      <muleVersion>${app.runtime}</muleVersion>
      <uri>https://anypoint.mulesoft.com</uri>
      <target>${target}</target>
      <targetType>${target.type}</targetType>
      <username>${username}</username>
      <password>${password}</password>
      <environment>${environment}</environment>
      <properties>
        <key>value</key>
      </properties>
    </armDeployment>
  </configuration>
</plugin>
```

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

```console
mvn clean package deploy -DmuleDeploy
```

### 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>Authenticate with the username and password for the server where your Mule instances are installed.</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 Manager REST API Deployment Parameters Reference](#arm-deploy-reference).

### Runtime Manager REST API 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>armDeployment</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>applicationName</code></p></div></div></td><td><div><div><p>Specifies the application name to use during deployment.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>muleVersion</code></p></div></div></td><td><div><div><p>The Mule version required for your application to run in your deployment target.<br>If this value does not match the Mule version running in your deployment target, the plugin raises an exception.</p></div><div><p>The Mule Maven Plugin does not download a Mule runtime engine if these values don’t match.</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>The Anypoint Platform URI. If you are using Anypoint Platform PCE, specify this parameter with your Anypoint Platform installation URI.<br>If not set, by default this value is set 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>target</code></p></div></div></td><td><div><div><p>The server name for the server where your Mule instances are installed.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>targetType</code></p></div></div></td><td><div><div><p>The type of target to which you are deploying.</p></div><div><p>Valid values are:</p></div><div><ul><li><p>server</p></li><li><p>serverGroup</p></li><li><p>cluster</p></li></ul></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>username</code></p></div></div></td><td><div><div><p>Your username for the server where your Mule instances are installed.</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 password for the server where your Mule instances are installed.</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>environment</code></p></div></div></td><td><div><div><p>The environment name for the server where your Mule instances are installed. This value must match any environment configured in your Runtime Manager account.<br>For Example:</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>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>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></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>
        ...
        <armDeployment>
          ...
          <server>my.anypoint.credentials</server>
          ...
        </armDeployment>
        ...
      </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.

### Troubleshoot TLS Errors in Anypoint Private Cloud Edition

When trying to connect to an instance of Runtime Manager that’s on an
[Anypoint Platform Private Cloud Edition](https://docs.mulesoft.com/private-cloud/latest/) installation, the plugin
validates certificates for that server. If you haven’t installed the server certificates in your
truststore, an SSL error occurs. To avoid this problem, you can run the plugin in an insecure mode,
which skips the security validations. You can use the **armInsecure** tag or the **arm.insecure**
system property.

> [!WARNING] Enabling an insecure connection is a dangerous practice. Don’t use this unless you know
> what you are doing and your On-Premises installation is isolated in a local network.

See the configuration example below:

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.4.2</version>
  <extensions>true</extensions>
  <configuration>
    <armDeployment>
        <target>${target}</target>
        <targetType>${target.type}</targetType>
        <username>${username}</username>
        <password>${password}</password>
        <environment>${environment}</environment>
        <armInsecure>true</armInsecure>
    </armDeployment>
  </configuration>
</plugin>
```

## Deploy a Mule Application Using the Runtime Manager Agent

Inside the `plugin` element, add a configuration for your Runtime Manager agent deployment,
replacing the URI value with your remote server information:

```xml
<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-maven-plugin</artifactId>
  <version>3.4.2</version>
  <extensions>true</extensions>
  <configuration>
    <agentDeployment>
      <uri>http://localhost:9999/</uri>
    </agentDeployment>
  </configuration>
</plugin>
```

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

```console
mvn clean package deploy -DmuleDeploy
```

### Runtime Manager Agent 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>agentDeployment</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>applicationName</code></p></div></div></td><td><div><div><p>Specifies the application name to use during deployment.</p></div></div></td><td><div><div><p>Yes</p></div></div></td></tr><tr><td><div><div><p><code>muleVersion</code></p></div></div></td><td><div><div><p>The Mule version required for your application to run in your deployment target.<br>If this value does not match the Mule version running in your deployment target, the plugin raises an exception.</p></div><div><p>The Mule Maven Plugin does not download a Mule runtime engine if these values don’t match.</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>The server URI where your Mule instances are installed.</p></div></div></td><td><div><div><p>Yes</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>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></tbody></table>

## Deploy a Domain

The Mule Maven plugin supports deploying domains only when using the standalone deployment strategy,
or the Runtime Manager agent deployment strategy.

To deploy a domain, use the same configuration and deployment steps you use when deploying an
application. For example, to deploy a domain to a standalone instance:

1.  Inside the `plugin` element, add a configuration for your standalone deployment, replacing the
    placeholder values with your local Mule runtime engine information:

    ```xml
    <plugin>
      <groupId>org.mule.tools.maven</groupId>
      <artifactId>mule-maven-plugin</artifactId>
      <version>3.4.2</version>
      <extensions>true</extensions>
      <configuration>
        <standaloneDeployment>
          <muleHome>${mule.home.test}</muleHome>
          <muleVersion>${app.runtime}</muleVersion>
        </standaloneDeployment>
      </configuration>
    </plugin>
    ```

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

    ```console
    mvn clean package deploy -DmuleDeploy
    ```

## Deploy Applications in Parallel

You can deploy applications in parallel to on-premises Mule instances. Deploying applications in
parallel reduces the startup time when you deploy a large number of apps. To prevent deployment
failure, ensure that applications are not dependent on each other because a particular start order
cannot be guaranteed.

Parallelism is fixed at 20.

To enable parallel deployment:

1.  Package or export your Mule applications to the `/apps` directory of your Mule runtime engine
    instance.

2.  Start Mule using the `-M-Dmule.deployment.parallel` option:

    ```none
    mule -M-Dmule.deployment.parallel
    ```

After performing these steps, Mule deploys in parallel all applications in the `/apps` directory.

## Update Applications at Runtime

Updating a Mule application at runtime can be a complex change involving class modifications,
endpoint modifications (for example, changing ports), and reconfiguring flows. An application update
first performs a graceful app shutdown and then reconfigures itself in the background within
seconds. This process is transparent for the users.

There are two ways you can update an application:

- By adding the modifications over an existing unpacked app folder and touching the main
  configuration file (`mule-config.xml` located in the app’s root directory by default).

- By adding a new `jar` with an updated version of the app into the `$MULE_HOME/apps` directory.
  Mule detects the `jar` as an updated version of an existing application and ensures the update by
  a clean redeployment of the app.  
  Note that Mule discards any modifications to the old application folder. The new app folder is a
  clean unpacked application from a `jar`.

Either method integrates well with existing build tools.

## See Also

- [Anypoint Runtime Manager Agent](https://docs.mulesoft.com/runtime-manager/runtime-manager-agent)

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