Over a million developers have joined DZone.

Mule 4 and Jenkins Pipeline

DZone's Guide to

Mule 4 and Jenkins Pipeline

In this artipostle, we look at how to use the new Mule Maven Plugin to deploy in Cloudhub through a simple Jenkins pipeline.

· Integration Zone ·
Free Resource

WSO2 is the only open source vendor to be named a leader in The Forrester Wave™: API Management Solutions, Q4 2018 Report. Download the report now or try out our product for free.


With the release of Mule 4, there are slight changes in the Mule Maven Plugin too. So, in this article, I am going to explain how to use the new Mule Maven Plugin to deploy in Cloudhub through a simple Jenkins pipeline.

Mule Maven Plugin

The most recent plugin (version 3.1.1) looks like the snippet below,

Image title

Slightly different from the previous version.

Jenkins Configuration 

After installing Jenkins, configure Maven in Global Tools Configuration section. In my case, I named it as maven. Also, configure credentials for your Anypoint Platform as shown in the below picture,

Image title

The credential ID in my case is ANYPOINT.


Create a very simple Jenkinsfile under the root of the project. The file is as shown below,

Image title

There are only two stages namely Build and Deploy.

Create Pipeline

In Jenkins, create a Pipeline item and configure it as follows.

Poll SCM 

I am polling every minute for SCM changes for this example. 

Image title

Pipeline Configuration

Configure the pipeline. In my case, my pipeline script (Jenkinsfile) resides in GitHub.

Image title

And that's it. You are done with the configuration. Now for every commit, the Jenkins job will be executed and thereby the pipeline will be executed, and the application will be deployed in the Cloubhub.


In this short article, I have demonstrated how easy it is to configure a Jenkins pipeline with Mule 4 Maven plugin. For demo purpose, I made the Jenkinsfile very simple but you can add more stages to it. The source code of the project can be found here.

Thank you.

IAM is now more than a security project. It’s an enabler for an integration agile enterprise. If you’re currently evaluating an identity solution or exploring IAM, join this webinar.

mule 4 ,integration ,jenkins ,mule maven

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}