Over a million developers have joined DZone.

Automated Deployment with Mule Management Console and Maven

DZone's Guide to

Automated Deployment with Mule Management Console and Maven

Automated deployment doesn't have to be difficult. Learn how to use the Mule management console and Maven to achieve automated deployment.

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

In my opinion a deployment of any application should be as automated as possible to avoid errors due to manual mistakes. This is no different with a Mule ESB application. If you are using the Enterprise Edition of the Mule ESB you also have the ability to make use of the Mule Management Console (MMC). This instrument makes the governance of the deployment of your Mule applications into different environments easier and therefore the whole deployment cycle less error-prone.

One item that I am missing in the MMC is to automatically add a new version of your Mule Application into the MMC. You can upload your Mule applications manually with MuleStudio (which enforces you to use MuleStudio of which I am not a big fan) or by uploading it by using the MMC itself being also manually.

Luckily there is one escape for this which is the REST API that is available for the MMC. Combined with a Maven plugin you can have your Mule application uploaded to the MMC and deployed automatically. Although Mulesoft doesn’t supply this plugin themselves I found an open source version here. I used this as my starting point and added a few enhancements that are useful (at least in my situation). The sources can be found here.
The situation I added is the following:

In case I upload a ‘SNAPSHOT’ version of an application, the existing application is removed from the MMC repository and the new SNAPSHOT version is added. In case of a non-snapshot version only a new version is allowed, an error message is received otherwise. Deployments that are already using the SNAPSHOT version will be redeployed with the new version. As a rule a SNAPSHOT version should only be deployed to the Test environment and never make it to Acceptance or Production.

When you have added the plugin to your Maven repository you can use it in your Mule project by adding the following configuration to your pom:


In my parent pom I have defined the property ‘muleApiUrl’ as:


The ServerGroup ‘Test’ refers to my Test Server in the MMC:
So every time I run ‘mvn install’ the Mule application is added to the repository of MMC and deployed to the Test environment. From the MMC it can then be promoted to Acceptance or Production.

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

web dev ,maven ,automated deployment

Published at DZone with permission of Pascal Alma. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}