Sdkman-cli: Maven: Wrong environment variable

Created on 13 Nov 2015  路  4Comments  路  Source: sdkman/sdkman-cli

When installing Maven, sdkman sets the MAVEN_HOME environment variable. This is probably wrong:
http://stackoverflow.com/questions/17136324/what-is-the-difference-between-m2-home-and-maven-home

Given that Maven 1 is not available for install with sdkman, it would probably be better if the variable was called M2_HOME instead.

Notice however, that the Maven homepage itself doesn't recommend setting an environment variable at all anymore: https://maven.apache.org/install.html (though some traces of M2_HOME remain).

Most helpful comment

It still seems like sdkman should be responsible for setting export M2_HOME=$MAVEN_HOME each time the version changes. Otherwise, running mvn will not find the libraries it needs to run.

All 4 comments

The home environment variable is auto-generated from the candidate's name, and not really used anywhere outside of sdkman itself. It is exposed to the user for the sake of fast access to the current candidate version directory. In other words, you can simply type cd $MAVEN_HOME to get there.

I'd suggest leaving the name of the home folder this way (unless of course it is breaking something).

Hope that makes sense!

Understood.

It still seems like sdkman should be responsible for setting export M2_HOME=$MAVEN_HOME each time the version changes. Otherwise, running mvn will not find the libraries it needs to run.

Just ran into this issue since some programs request the environment variable, it would be nice if SDKMAN handled this properly so I wouldn't have to go out of my way to set it myself

Was this page helpful?
0 / 5 - 0 ratings