unpack it to a folder, say /Users/yourid/Downloads/apache-maven-3.3.3
modify your ~/.bashrc, make sure the following lines are there
export M2_HOME=/Users/yourid/Downloads/apache-maven-3.3.3
export PATH=$PATH:$PATH:$M2_HOME/bin
now you can use maven in command line and eclipse or intellij etc.
advanced maven command line
mvn dependency:resolve install
mvn versions:set -DnewVersion=1.2.2
mvn clean install -U
mvn dependency:tree
Eclipse common maven actions
right click a project,preferences --> maven --> update project.
preferences --> Maven: select Download Artifact sources
preferences --> Maven --> installation: set the maven location
right click a project, run as --> maven install
No comments:
Post a Comment