Context: I install maven with brew install maven
In my ~/.zshrc
I have:
# Maven (mvn --version)
export MAVEN_HOME="$HOME/usr/local/Cellar/maven/3.6.3"
export PATH=$MAVEN_HOME/bin:$PATH
Is there a way to set my MAVEN_HOME in a way that allows me to not have to increment it when Maven is upgraded to 3.6.4?
It is somewhat tedious to have to go into my config file and update it every time I update Maven! :)
This would also help an onboarding/setup script that could download maven and programmatically set up a ~/.zshrc
or ~/.bashrc
config
Per @chepner: /usr/local/bin/mvn
is a symlink to the latest installed version when installed via homebrew.
I changed export MAVEN_HOME="/usr/local/Cellar/maven/3.6.3/mvn"
to export MAVEN_HOME="/usr/local/bin/mvn"
in my ~/.zshrc
config and everything is good to go.