---
schema_version: "1"
id: ee608e4505a334fa0ff8e7913d0d1e9255092efb9b5ca85cef021d2cccfbe084
title: Application Deployment
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/accelerators-home/application-deployment.md
canonical_url: https://docs.mulesoft.com/accelerators-home/application-deployment
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 074a243c8595c5c96e98e8bbc5831c566f4d077138ad7c949a4c408be3c40fef
description: MuleSoft Documentation Site
latest: true
---
---
product: Accelerators
---

# Application Deployment

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

Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building
and deploying the APIs to CloudHub. These scripts depend on repositories, global settings,
deployment profiles, and associated properties configured in the Maven `settings.xml` file.

Many templates can also be run from Anypoint Studio without having to customize the Run/Debug
profiles. However, some templates make use of hidden deployment properties to protect sensitive
information such as passwords and secret keys. These properties must be supplied to the runtime by
updating the configuration profile and adding them as VM arguments.

## Running the Application from Anypoint Studio

The following instructions are for running applications from Studio but apply to debugging as well.

1.  Update the `src/main/resources/config/config-local.yaml` file and provide appropriate values for
    any mandatory property overrides listed for that application.

2.  Right-click the project and select **Run As → Mule Application (configure)**

3.  If hidden deployment properties are required (for example, Anypoint MQ credentials), select the
    **Arguments** tab and add the property definitions to the **VM arguments** section as shown in
    the following example.

    -M-Danypoint-mq.client-id=<client id> -M-Danypoint-mq.client-secret=<client secret>

    - Click **Run** to launch the application.

To debug an application, choose **Debug As → Mule Application (configure)** in the second step
instead.

## Deployment Instructions for CloudHub

The following instructions apply to CloudHub deployments only.

1.  Update the `config-dev.yaml` properties as described above. You can also choose to add them to
    your `settings.xml` file instead.

2.  Use one of the following scripts to deploy the application to CloudHub:

    - `packageDeploy.sh` (Mac/Linux) or `packageDeploy.cmd` (Windows) - clean, build, and deploy the
      application

    - `deployOnly.sh` (Mac/Linux) or `deployOnly.cmd` (Windows) - deploy a previously-built
      application

3.  Bring up the Runtime Manager console in Anypoint and monitor the application for proper startup.

See below for more detailed steps on configuring CloudHub deployments using Maven profiles.

### Configuring the Deployment Profile

The default `settings-accelerators.xml` file, provided by the "Accelerator Common Resources -
Source" asset, defines a single deployment profile called `CloudHub-DEV`. The key properties that
can be configured are described in the following table:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Property Name</th><th>Description</th><th>Mandatory</th></tr></thead><tbody><tr><td><p>cloudhub.mavenServerId</p></td><td><p>Maven server entry providing credentials for target Anypoint instance</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.region</p></td><td><p>Target deployment region</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.businessGroupId</p></td><td><p>ID (not name) of the target business group</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.environment</p></td><td><p>Exact name of the target deployment environment (case-sensitive)</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.applicationName</p></td><td><p>Constructs the deployed application name from app/env properties</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.muleVersion</p></td><td><p>Target Mule runtime version</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.applyLatestPatch</p></td><td><p>Set to true to automatically apply latest patches on deployment</p></td><td><p>no</p></td></tr><tr><td><p>cloudhub.workerType</p></td><td><p>Worker size (translates to vCores)</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.workers</p></td><td><p>Number of workers</p></td><td><p>yes</p></td></tr><tr><td><p>cloudhub.objectStoreV2</p></td><td><p>Set to true to use ObjectStore V2</p></td><td><p>no</p></td></tr><tr><td><p>cloudhub.persistentQueues</p></td><td><p>Set true to use persistent queues</p></td><td><p>no</p></td></tr><tr><td><p>cloudhub.skipDeploymentVerification</p></td><td><p>Set to false to wait for application to be fully deployed before continuing</p></td><td><p>no</p></td></tr><tr><td><p>cloudhub.deploymentTimeout</p></td><td><p>Amount of time (in milliseconds) to wait for complete application deployment</p></td><td><p>no</p></td></tr><tr><td><p>mule.environment</p></td><td><p>Specifies the configuration properties files to use</p></td><td><p>yes</p></td></tr><tr><td><p>mule.encryptionKey</p></td><td><p>If secured properties are used an encryption key is required</p></td><td><p>no</p></td></tr><tr><td><p>anypoint.platform.clientId</p></td><td><p>Client ID of the target environment or business group</p></td><td><p>yes</p></td></tr><tr><td><p>anypoint.platform.clientSecret</p></td><td><p>Client secret of the target environment or business group</p></td><td><p>yes</p></td></tr><tr><td><p>anypoint.platform.enableMonitoring</p></td><td><p>Set to true to enable monitoring and visualization</p></td><td><p>no</p></td></tr></tbody></table>

> [!NOTE] The template described previously is generic. Many accelerators provide their own version
> of the common resources project, which contains a similar template specialized for that
> accelerator.

### Application Naming

The default setting for the `cloudhub.applicationName` property constructs the application name base
on the following segments:

- Global Prefix (default is `org-`)

- Maven artifact ID (from project pom.xml)

- API compliance version (from project pom.xml)

- Target environment name (hard-coded for profile)

An example of a deployed application name using the default settings is
`org-notifications-prc-api-v1-dev`.

> [!IMPORTANT] CloudHub application names must be _globally_ unique. Therefore, we highly
> recommended you set the `global.cloudhub.appPrefix` property, which is defined in the
> `global-settings` profile, to a 2-4 character abbreviation unique to your organization. Exceeding
> four characters may cause deployments to fail when using the CloudHub 1.0 runtime (see below).

### Deploying Applications Using Maven Profiles

Once appropriate values have been defined for the properties for the environment profile, individual
applications can be deployed to that environment simply by specifying the profile name on the Maven
command line. For example, the command `mvn clean deploy -DskipTests -PCloudHub-DEV` uses the
settings in the `CloudHub-DEV` profile to build and deploy the application.

## Troubleshooting

The following sections provide solutions to common deployment issues.

### Error Deploying Project Imported into Anypoint Studio

If you choose to import accelerator projects into Anypoint Studio, be aware that Studio may
automatically make modifications to the application `pom.xml` files, which could impact deployment.
In particular, be sure to cancel the prompt to "Upgrade your workspace" when importing projects. If
you run into trouble, check the `pom.xml` file and verify the configuration of the
`mule-maven-plugin` looks something like the following:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <cloudHubDeployment>
        ...
        </cloudHubDeployment>
        <classifier>${mule.app.classifier}</classifier>
    </configuration>
</plugin>

Make sure there is no `<version>` element included and that the `<classifier>` element contains the
property reference indicated above.

### Unauthorized Error

If deployment fails due to an `unauthorized` error, it is possible that the complete application
name exceeds the 42 character limit on CloudHub deployment names. Adjust the prefix, the
`artifactId` value in the project pom.xml, or the deployment name pattern to ensure the complete
application name does not exceed 42 characters in length.

## See Also

- [Getting Started](https://docs.mulesoft.com/accelerators-home/getting-started)

- [Build Environment](https://docs.mulesoft.com/accelerators-home/build-environment)

- [Application Testing](https://docs.mulesoft.com/accelerators-home/application-testing)

- [Additional Customizations](https://docs.mulesoft.com/accelerators-home/additional-customizations)

- [MuleSoft Accelerators](https://docs.mulesoft.com/accelerators-home/)
