How to "add Maven nature" to existing netbeans project?

3.1k Views Asked by At

I know "adding Maven nature" is an Eclipse term.

Actually I want to add SOME dependencies from maven repository by editing pom.xml file. Is it possible? I want to remain a directory structure and other JAR tracking of a project intact.

The project is of jMonkey SDK.

2

There are 2 best solutions below

4
On
  • add minimal pom.xml file
  • close project
  • re import it to netbeans as maven project

  • or create a new minimal maven project and delete source and resource directories and place your project stsructure and

  • configure pom.xml to match with your directory structure

    • by specifying resources & source directories in pom.xml
2
On

in netbeans there are no natures. Either the project is a maven project (by having a pom.xml file in project directory) or it's not. No matter what type, projects are just opened.

if your project is both ant based project (having nbproject/project.xml file and build script) and contains pom.xml, then the ant project takes priority and will be opened as ant project. No way to mix then. to load as maven project you will have to delete ant project related files and restart the IDE.