Automated deployment with Mule Management Console and Maven

3 Jan

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.

2 Responses to “Automated deployment with Mule Management Console and Maven”

  1. krizsan 09/01/2014 at 06:17 #

    Thanks! I have been thinking about using the REST interface of the MMC for a while but haven’t quite found the time.


  1. Bookmarks #2 | Adao Feliz - Software Craftsman - Blog - 09/01/2014

    […] Automated deployment with Mule and Maven – Continuous Delivery is trending up as a design practice for software delivery. Pascal Alma shows how to integrate Mule Management Console (MMC) and Maven, enabling a automatic deployment of any application avoiding errors that could be caused by manual mistakes. There are other options as Rundeck but Mule isn’t bad at all. […]

Comments are closed.


Get every new post delivered to your Inbox.

Join 99 other followers

%d bloggers like this: