Search code examples
javaeclipsemavenm2e

How to add "Maven Managed Depenencies" for a simple java project?


I created a simple Java project (NOT a maven project) in Eclipse. How can I add "Maven Managed Dependencies" to it?

I tried to right click the project node. There's no "Maven" option in the right click menu. And there's no POM.xml file.

enter image description here


Solution

  • You can create a simple project in New --> Other --> Maven Project

    enter image description here

    If your project is a simple java project, you can convert it. Right click on project, Configure --> Convert to Maven Project:

    enter image description here

    Enter the details to create the pom file.

    enter image description here

    After that, you can add dependencies by right click on project, Maven --> Add Dependency, or just add dependency in the generated pom.xml.