2 maven versions installed local repository .m2 code example
Example: maven print repository location
RESULT=$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)
RESULT=$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)