Configuring Maven for Java Frameworks

installing/configuring maven


  1. download maven:
    1. navigate to https://maven.apache.org/download.cgi
    2. click link for Binary tar.gz archive: apache-maven-3.3.9-bin.tar.gz
    3. save it to Desktop
  2. create /usr/local/apache-maven folder:
    1. on finder, click Go tab
    2. click Go To Folder…
    3. type /usr/local    - then click Go
    4. create a folder called apache-maven
    5. copy the apache-maven-3.3.9-bin.tar.gz folder from Desktop into the apache-maven folder
  3. configure Java JDK Path and Maven path in .bash_profile:
    1. download Java JDK for Mac OS X - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
    2. open a terminal and type: /usr/libexec/java_home   - then copy the path for the java idk that is returned
    3. type the following four commands into the terminal, hit enter after each one:export
      1. JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home    (if this path differs from the one you copied, substitute it with the one you copied)
      2. export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9   
      3. export M2=$M2_HOME/bin
      4. export PATH=$M2:$PATH
    4. type command in terminal: source ~/.bash_profile
    5. verify Java JDK and Maven are installed by typing command in terminal: mvn —v

No comments:

Post a Comment