Topics:
- What is Maven?
- What is POM and different tags in POM.
- Maven as dependency management.
- Maven as build management. - Maven Lifecycles, Maven phase vs goals,
Mule Maven plugin
- Using settings.xml
- Deploy application to Cloudhub using Mule Maven Plugin.
- Deploy assets to exchange using Mule Maven Plugin and Exchange Mule Maven Plugin.
2. Safe Harbour Statement
● Both the speaker and the host are organizing this meet-up in individual capacity only. We are
not representing our companies here.
● This presentation is strictly for learning purposes only. Organizer/Presenter do not hold any
responsibility that same solution will work for your business requirements.
● This presentation is not meant for any promotional activities.
2
3. A recording of this meetup will be uploaded to events page within 24 hours.
Questions can be submitted/asked at any time in the Chat/Questions & Answers Tab.
Make it more Interactive!!!
Give us feedback! Rate this meetup session by filling feedback form at the end of the day.
We Love Feedbacks!!! Its Bread & Butter for Meetup.
Housekeeping
3
5. 5
● What is Maven?
● What is POM and different tags in POM.
● Maven as dependency management.
● Maven as build management. - Maven Lifecycles, Maven phase vs goals,
● Mule Maven plugin
● Using settings.xml
● Deploy application to Cloudhub using Mule Maven Plugin.
● Deploy assets to exchange using Mule Maven Plugin and Exchange Mule Maven Plugin.
Agenda
7. 7
- Maven is a popular build automation and project management tool used primarily in Java-based
projects.
- Provides a framework for managing software builds, dependencies, and project configurations.
- Maven helps simplify the software development process by automating tasks such as compiling
source code, managing libraries and dependencies, running tests, packaging applications, and
generating project documentation.
Maven uses a project object model, defined in an XML file called “pom.xml”, to configure and
manage project settings.
Maven
9. 9
- Project Object Model File
- Contains important informations related to the project.
- Packaging type
- dependencies and their repository where they reside
- Build configurations and plugin management
- pom.xml implicitly inherits Super POM
The POM
14. 14
- Maven is responsible for building the project and providing the deployable
archive (JAR file).
- Maven uses three lifecycle phases in their build management. (the build
lifecycles)
- default, site, clean
- the default lifecycle consists of the phases
- validate, initialize, compile, test, package, verify, install, deploy
- A lifecycle is made up of cascading ordered phases, with each phase
executing all the proceeding phases leading up to it.
Build Management
16. 16
- Mule Maven Plugin is built by Mulesoft to bind mule specific functionality to
maven phases.
- For example:
- mvn package will produce a jar file.
- mvn deploy will do a “mvn package” i.e to produce a jar file and deploy that jar to configured
environments like CH, RTF, Standalone etc.,
- https://docs.mulesoft.com/mule-runtime/4.3/mmp-concept
Mule Maven Plugin
18. 18
Settings.xml File
- The settings element in the settings.xml file contains elements used to define
values which configure Maven execution in various ways.
- The repositories for download and deployment are defined by the repositories
and distributionManagement elements of the POM. However, certain settings
such as username and password should not be distributed along with the
pom.xml. This type of information should exist on the build server in the
settings.xml.
20. Cloudhub deployment
- You could deploy mule
applications to Cloudhub
via maven by adding
configuration inside
mule-maven-plugin.
> mvn -DmuleDeploy deploy
20
21. Deploy assets to exchange using
Mule Maven Plugin &
Exchange Mule Maven Plugin
22. Exchange Mule Maven Plugin
- With the Anypoint Exchange Maven Facade
API, Apache Maven clients can publish and
consume Exchange assets, including these
asset types:
- Connectors
- Mule applications
- Examples
- Templates
- Policies
- Custom assets
- https://docs.mulesoft.com/exchange/
to-publish-assets-maven
22
25. Take a stand !
26
●Nominate yourself for the next meetup speaker and suggest a topic as well.
26. 27
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/calicut/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?