Maven For Mac

In this video i will show you how to install maven on mac.

Install Maven For Mac

By default, Maven local repository is defaulted to ${user.home}/.m2/repository folder :

  1. Unix/Mac OS X – ~/.m2/repository
  2. Windows – C:Users{your-username}.m2repository

When we compile a Maven project, Maven will download all the project’s dependency and plugin jars into the Maven local repository, save time for next compilation.

1. Find Maven Local Repository

Apache Maven For Mac

1.1 If the default .m2 is unable to find, maybe someone changed the default path. Issue the following command to find out where is the Maven local repository:

1.2 Example :

In above output, The Maven local repository is relocated to C:optmaven-repository

2. Update Maven Local Repository

2.1 Find this file {MAVEN_HOME}confsettings.xml and update the localRepository.

{MAVEN_HOME}confsettings.xml
Note
Issue mvn -version to find out where is Maven installed.

2.2 Save the file, done, the Maven local repository is now changed to D:/maven_repo.

References

About the Author

mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Install Maven Mac High Sierra

Hello Mac User! This Tutorial Shows You Step-by-Step How-to Install Maven on Mac High Sierra 10.13 OS X BSD/Unix Desktop.

And Latest Maven for Mac 10.13 calls its build scripts Project Object Model (POM) files. These POM files are in XML, and each Maven project or module will have an accompanying pom.xml file.

Furthermore Project Management Tool such as Maven provides a Superset of features found in a Build Tool.

In Addition to providing Build capabilities, Maven can also Run Reports, Generate a Web Site, and Managig Communication among members of a Working Team.

Install Maven For Mac

Finally to Install Maven on Mac High Sierra a Working Java JDK 6+ Installation is Required, so You will Find Link to Installing Oracle Java JDK 7 on Mac OS X.

Download Maven For Mac

Maven For Mac

Install Maven Mac Os

  1. Download Apache Maven 3.x Binaries:
  2. Double-Click on Maven Archive to Extract

  3. Open Terminal Window
    (Press “Enter” to Execute Commands)

  4. Verify that JDK 7+ is Installed on System

    How-to Install Oracle JDK on Mac OS X:

  5. Relocating Maven Binaries
    Switch to the Target directory:

    Then Login as Super-user:

    If Got “User is Not in Sudoers file” then Look: Solution
    Remove the tar.gz archive:

    Fix Permissions:

    Switch the Maven contents:

    Achieve the Admin session:

  6. Add Maven Binaries to User Path

    Append:

    Change the [X.Y.Z] with the actual Maven Version!
    Ctrl+x to Save and Exit from “nano” 🙂
    To Load the New SetUp:

  7. Test Maven Installation

  8. Quick-Start with Maven Projects Management:

  9. Quick-Start with Eclipse Java Developers on Mac OS X:
    SetUp Eclipse for Java on Mac.