How to setup Maven in macOS for Mule applications.
To setup Maven on macOS for Mule applications perform the following:
1. Download maven from the link below:
https://maven.apache.org/download.cgi — file - apache-maven-3.8.6-bin.zip (whatever latest version)
2. Extract the zip in users folder.
3. Edit .zshrc file in your mac. If you do not have, you can create a file with extension .zshrc
- Contents for the .zshrc file:
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home" (Put your own jdk path)
PATH="${JAVA_HOME}/bin:${PATH}"
export PATH
export M2_HOME="/Users/{userName}/apache-maven-3.8.6" (Put your own maven path)
PATH="${M2_HOME}/bin:${PATH}"
export PATH
NOTE: You can find the java installed in your system through this command:
/usr/libexec/java_home -V
4. Verify the java home using the below command:
$ java -version
5. Verify m2 home using the below command:
$ mvn -version
6. Try to run the mvn script through normal terminal and check the security setting in MAC whether it is blocking the execution. Click on Open Anyway.
7. Quit the terminal and save everything.
8. Run a fresh session and type mvn -v to check if you get the details of the maven installed.
001115431

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.