-1

I know Maven is very popular and I have used it only when given exact step by step guides. I would like to know, how do you use it in the general context?

For example, I recently cloned this GIT repo https://github.com/mrniko/netty-socketio/tree/netty-socketio-1.7.7 into Eclipse using the Git import tool. This software comes with none of the dependencies, but the expectation is I get them through Maven/Pom.xml.

However, I am stumped at this point. I am using Eclipse Luna and I don't see any option to "resolve dependencies"? I would think it'd be a simple button to press.

Obviously its not as simple as that! Any help would be great before I start downloading my dependencies one by one from their sites! (just kidding)

I hope to not make a Stackoverflow post for each time I want to resolve my maven issues, so I hope that I can learn a bit more about maven troubleshooting through this!

E.S.
  • 2,733
  • 6
  • 36
  • 71
  • I don't understand your question. Do you want to download every dependency jar manually rather than let maven do it for you (like in ye olde times aprox ~ 15 years ago)? – Luiggi Mendoza Apr 27 '15 at 22:54
  • @LuiggiMendoza, No. Not at all. I am asking for help in using Maven through this particular git project example. – E.S. Apr 27 '15 at 22:56
  • Uhm ok. First make sure your project is imported in Eclipse and configure it as a maven project by following this guide: http://crunchify.com/how-to-convert-existing-java-project-to-maven-in-eclipse/. Note that if the project already contains a pom.xml file and a compliant maven-project structure, then you should only use the first step. – Luiggi Mendoza Apr 27 '15 at 22:59
  • Once you have imported your project into Eclipse you can right click the project, go down to Configure, and Convert to Maven Project. To build right click on your new Maven project and go to Run As > Maven Install. Assuming the POM is correct you should see all the dependencies downloading. You'll get a new directory in your project called target with your new jar. – Scott Apr 27 '15 at 23:04

1 Answers1

1

You've imported the project using the Git import function, which means that Eclipse has probably not recognized that the project is a Maven project.

You can solve this by right-clicking on the project folder in Eclipse's package explorer, selecting "Configure..." and then selecting "Convert to Maven project". Once you do this, the Eclipse M2E plugin will automatically read the project POM and download all necessary dependencies.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Something must be missing in the pom.xml for this project, as none of this is happening naturally. I am trying it in Cloud9.io since there I can (in a way) bypass any proxy/firewall I am facing here to compile this. No go there either. – E.S. Apr 27 '15 at 23:42
  • Hm, you may need to run 'Maven' -> 'Update project' from the same right-click menu. – Jeen Broekstra Apr 28 '15 at 01:02