Mulesoft 4: Continuous Delivery/Deployment With Maven
The main aim of this article is to provide a standard mechanism to release project artifacts and deploy to Anypoint Platform.
Join the DZone community and get the full member experience.Join For Free
The main aim of this article is to provide a standard mechanism to release project artifacts and deploy to Anypoint Platform, from the local machine or configure in continuous delivery pipelines.
Normally multiple people involved in the deployment process, one team/team member may handle check-in of code, others may handle configuration, and so on. very likely that any step may be missed out due to manual efforts.
- Untested code gets to build and deploy.
- Uncommitted code gets to build and deploy.
- The deployment team deployed the older build again.
- Running local build fails on the server.
- Configuration, not sync’s.
Minimum Anypoint Platform Role
CloudHub Developer / Developer
Anypoint Platform Credentials
To deploy mule applications using a mule maven plugin, need to set the Anypoint platform credentials, please update Anypoint platform credentials information in the .m2/settings.xml as the following:
Update GroupId in POM.XML
To set of identifiers to update groupId with an Organization ID.
Update SCM (Source Code/Control Management) Details in POM.XML
To release prepare mule applications using a mule maven plugin, we need to update SCM details.
Update Distribution Management
To release perform and upload deployable mule applications using a mule maven plugin, need to update Distribution Management details.
For CloudHub Deployment
Update pom.xml with cloudHub Deployment configuration.
For Runtime Fabric Deployment
Update pom.xml with Runtime Fabric Deployment configuration.
For Standalone Runtime Deployment
Update pom.xml with Standalone Runtime Deployment configuration.
After configuring all the prerequisites, make sure you are pointing at the branch you want to release. all your code is committed and pushed and pulled the latest version from origin
run: mvn release:prepare
The release:prepare goal will:
- Verify that there are no uncommitted changes in the workspace.
- Verify that there are no SNAPSHOT dependencies
- Prompt the user for the desired tag, release, and development version names.
- Modify and commit release information into the pom.xml file.
- Tag the entire project source tree with the new tag name.
- Move forward the version in the POMs to next SNAPSHOT version
- Commit the modified POMs.
Checks out the code using the previously defined tag and run the Maven deploy goal, upload deployable or artifact to Anypoint Exchange repository.
mvn -B release:perform
Please check out the release tag for deployment:
git checkout --no-track -b deploytag <deployment-tag> --
mvn deploy -DmuleDeploy -DmuleVersion=?
To Runtime Fabric
mvn deploy -DmuleDeploy -Danypoint.businessGroup=?
mvn deploy -DmuleDeploy -Dmule.home=?
Please refer to Mulesoft Documentation for Additional information.
Opinions expressed by DZone contributors are their own.