I installed OpenMRS SDK and maven and I ran the command :
“mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk”
as mentioned in OpenMRS SDK - Documentation - OpenMRS Wiki
though, when I run the command: omrs-version I get this error:
You are using an old version of the sdk (1.0.7 but sdk is already in 2.x realm). I can only imaging that you are reading the developers guide and thats where you found the old sdk. But that guide has not been updated for a while now. Here is a link to the latest version of the sdk, https://wiki.openmrs.org/display/docs/OpenMRS+SDK. Try the instructions stated there to work with new the latest version of the sdk. Also in future it would be nice if you check the instructions on the guide with that on the wiki since the wiki is more frequently updated than the guide.
About your m2_home referring to a wrong directory, mvn -v working does not mean that (M2_HOME) has been properly set, it simply means that, “mvn” is in your path variable, which is usually done by adding the bin directory of maven to the path. To be sure that your M2_HOME is properly set and its just the sdk that is giving errors, trying this
echo %M2_HOME% (in a linux shell that would be, echo $M2_HOME)
You should see something like, “C:\Program Files\apache-maven-3.3.9”. If you don’t then you have not properly set M2_HOME