The Mule ESB-maven-plugin is a separate plugin which is used to handle below things:
- Start a standalone mule server [installs Mule as a service in Win32 machines]
- Deploy domain
- Deploy application(s)
- Run unit tests (MUnit) from application(s)
- Stop standalone mule server [uninstalls Mule service in Win32 machines]
This is much more powerful than running a traditional unit tests since we can run multiple applications at the same time.
The reader of this article is assumed to possess some basic knowledge of Maven.
Add the mule-esb-maven plugin to pom.xml file (Please note that it compiles the Java code in the project which is already existing)
<!-- provide the zip file name for application1 to be deployed-->
<application>path-to zip file application1</application>
<!-- provide the zip file name for BS application2 to be deployed -->
<application> path-to zip file application2</application>Internal Use
<!-- provide the zip file name for domain (if its used) -->
<domain> path-to zip file of application domain</domain>
<!-- Provide name of Groovy script which can do few utility tasks:
a) Example update conf/properties in standalone for the UTCs to run
b) Update /lib/user folder for shared libraries, etc
<!-- <script>/home/mule/mvn/thisproject/script.groovy</script> -->
<!-- phase is deploy phase where Mule ESB is installed as a Windows
service and started -->
<!-- phase is post integration test phase where Mule ESB is uninstalled
as a Windows service-->
2. Add the dependent jar files to lib/user folder of mule standalone
1. mvn -X clean deploy post-integration-test -f xml -Dmule.home=”path –to-mule -standalone
2. mvn -X test surefire-report:report-only -Dtest='UnitTestCase' -DfailIfNoTests=false
-Dmule_home=path-to- mule-home -Dcredentials_vault_key=XXXXXXXX
This command compiles the application code deploys the snippets to mule server by starting the mule server as a service and runs the test cases. Surefire reports can also be generated using this plugin using second command.
If you would like to find out more about how Systems Integration could help you make the most out of your current infrastructure while enabling you to open your digital horizons, do give us a call at +44 (0)203 475 7980 or email us at firstname.lastname@example.org.
Other useful links: