Then I opened the repo in eclipse and then eclipse started downloading the required dependency. But get an error in “messaging-api-0.9.0-beta.jar" dependency.
Error: The container 'Maven Dependencies' references non existing library '/home/dhananjay/.m2/repository/org/openmrs/module/messaging-api/0.9.0-beta/messaging-api-0.9.0-beta.jar'
You may have had a network issue when maven was downloading the required repositories that is why you didn’t have the right jars. adding a -U to a maven clean install will get them for you. So if the above solutions aren’t working try this:
Right click on your project -> Choose Run as -> Maven build...
In the Goals field type "clean install -U" and select Run
After that completes right click on your project again and choose Maven -> Update Project and click ok.
If your internet is okay and still getting the error, then do Project->Clean and then be sure you have selected your project directory and then do the follow Project->Build.