Mule Maven Plugin

Published on
March 3, 2022
Author
MuleSoft Integration Team
Mule Maven Plugin

One of the ways to deploy the MuleSoft Application is using the Mule Maven Plugin. In Mule 4, when the new project is created, we find pom.xml in the project structure. Pom.xml file contains the dependency information of the modules used in the project. It manages dependencies which are required to run the application. Steps… Continue reading Mule Maven Plugin

One of the ways to deploy the MuleSoft Application is using the Mule Maven Plugin.

In Mule 4, when the new project is created, we find pom.xml in the project structure.

Pom.xml file contains the dependency information of the modules used in the project.

It manages dependencies which are required to run the application.

Steps to deploy the MuleSoft Application using Mule Maven Plugin are as follows:

  1. Make sure Maven is installed in your system.
  2. Create MuleSoft Project in AnypointStudio

As mule 4 projects are mavenised, so we have a pom.xml file created in the project.

The MUnit code coverage should be more than 70-80% before deploying the application.

3. Add configuration in pom.xml file

Copy Paste <configuration> tag in mule plugin section in pom.xml

<plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>${mule.maven.plugin.version}</version> <extensions>true</extensions> <configuration> <cloudHubDeployment> <muleVersion>{mule.version}</muleVersion> <username>${username}</username> <password>{password}</password> <environment>${environment}</environment> <applicationName>${application.name}</applicationName> <workers>${workers}</workers> <workerType>${worker.type}</workerType> <objectStoreV2>true</objectStoreV2> </cloudHubDeployment> </configuration> </plugin> 

Note:

  • Maven Credentials should be passed through Secrets (It might be AWS, Jenkin, Azure etc).
  • Property Masking should be done to mask the credentials at runtime properties in mule-artifact.json file as shown below: 

 { "minMuleVersion": "4.3.0", "secureProperties": ["mule.key"] } 

4. Run Maven Commands to deploy Application to CloudHub

  • Open Command prompt from the Project Workspace location.
  • Run below commands in command prompt.

mvn clean install: This command will delete all existing compiled files. Make sure the build should be successful.

mvn package deploy: Refer below command to deploy the application to CloudHub and replace the credentials with your Anypoint Platform Credentials.

mvn package deploy -Dusername=MuleSoftUser-Dpassword=password -Denvironment=Sandbox -Dmule.version=4.3.0 -Dworkers=1 -Dworker.type=Micro -Dapplication.name=mule-demo-application -DmuleDeploy 

A jar file automatically will get created then the application will be deployed to Anypoint Platform.

Go to the Runtime Manager and check the status of the Application.

You can test the application when the status changes to “Started”.

While deploying the application, you may face few errors.

  1. Validation exception: The following mandatory fields in the mule-artifact.json are missing or invalid:
  • [name,classLoaderModelLoaderDescriptor, classLoaderModelLoaderDescriptor.id, requiredProduct]. requiredProduct valid values are: MULE, MULE_EE -> [Help 1]

To resolve this error, update missing name, classLoaderModelLoaderDescriptor, requiredProduct in mule-artifact.json file.

mule-artifact.json

{ "name": "mule-maven-plugin-poc", "minMuleVersion": "4.3.0", "secureProperties": ["mule.key"], "requiredProduct": "MULE_EE", "classLoaderModelLoaderDescriptor": { "id": "mule", "attributes": { "exportedResources": [] } } } 
  1. mule.tools.client.standalone.exception.DeploymentException: Domain is not available. Aborting.

This error occurs due to duplicate application name in CloudHub, and rename it with a unique name.

  1. 400 Bad Request: {“status”:400,”message”:”Object Store V1 is not supported for your org”}

Find more MuleSoft Technical Guides at Caelius Consulting’s Resource Centre.

Recent Blogs

Connecting MuleSoft and Azure SQL with Entra ID
BlogJul 14, 2025

Connecting MuleSoft and Azure SQL with Entra ID

Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID

Read More
Blog
2 min read

Connecting MuleSoft and Azure SQL with Entra ID

Introduction Establishing a secure connection between MuleSoft and Azure SQL Database can be challenging, especially if you are using Entra ID (formerly known as Azure Active Directory) for authentication. This blog walks through a fully working configuration for connecting to Azure SQL using ActiveDirectoryServicePrincipal in Mule runtime 4.7.4 with Java 8 — addressing driver setup,… Continue reading Connecting MuleSoft and Azure SQL with Entra ID

Read More
Understanding Salesforce Flow Approval Processes
BlogJun 30, 2025

Understanding Salesforce Flow Approval Processes

Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes

Read More
Blog
5 min read

Understanding Salesforce Flow Approval Processes

Introduction: Salesforce introduced Flow Approval Processes in the Spring '25 release. This is an evolved version of the classic approval process model, powered by Flow Orchestrator. The new approach brings unprecedented flexibility, enabling the creation of dynamic, multi-level, and logic-driven approval workflows that are entirely declarative. Continue reading the blog to get a deeper understanding… Continue reading Understanding Salesforce Flow Approval Processes

Read More
Capturing Real-time Record Updation Using LWC
BlogMay 14, 2025

Capturing Real-time Record Updation Using LWC

Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC

Read More
Blog
5 min read

Capturing Real-time Record Updation Using LWC

Introduction In modern CRM ecosystems, real-time Salesforce integration and seamless user experiences are no longer optional but fundamental for driving operational efficiency. Imagine your sales reps making important Opportunity changes, but the ERP remains out of sync, leading to confusion and data errors. We understood the necessity to bridge this data gap and implemented a… Continue reading Capturing Real-time Record Updation Using LWC

Read More
All About Schedulers: Mule 4
BlogMay 7, 2025

All About Schedulers: Mule 4

In the world of Mule 4, automating repetitive tasks and triggering flows at defined intervals is necessary for building efficient and robust integration solutions. This is where Mule 4 schedulers come into use. This blog post explores the intricacies of scheduling in Mule 4, providing practical examples and best practices to help you get deeper… Continue reading All About Schedulers: Mule 4

Read More
Blog
7 min read

All About Schedulers: Mule 4

In the world of Mule 4, automating repetitive tasks and triggering flows at defined intervals is necessary for building efficient and robust integration solutions. This is where Mule 4 schedulers come into use. This blog post explores the intricacies of scheduling in Mule 4, providing practical examples and best practices to help you get deeper… Continue reading All About Schedulers: Mule 4

Read More