How to integrate maven 2 into an existing netbeans project?

How to integrate maven 2 into an existing netbeans project?

I don’t want to do this by creating a new maven web application project and manually moving the files to a new project (since I have versions of this project in my subversion repositories that I cannot link if I create a new project), rather I need to integrate this into my existing netbeans project. How can I do it? Will creating pom.xml work?


Maven 2 is already installed on my machine.

+8
maven netbeans
source share
1 answer

How to create a new Maven web project and move pom.xml back to an existing web project? I mean:

  • Backup Projects
  • Create a new project called MavenWebTest
  • Close your original project
  • Move pom.xml from the MavenWebTest project to the project source folder
  • Change the specific parameters of the pom.xml project (e.g. project name, dependencies)
  • Delete the build.xml folder and the whole nbproject
  • Move and rename the web folder to src/main/webapp ( webapp is the new name) (use svn mv if you use Subversion)
  • Move src/java to src/main/java ( svn mv here too)
  • Open the project again in Netbeans. Now it should be a Maven project.
  • Delete unnecessary MavenWebTest project

Anyway, creating an empty pom.xml should also work. You must specify your dependencies in pom.xml and you must set the project name. Perhaps other tweaks also required the same result as Netbeans without Maven. If you create pom.xml with Netbeans (MavenWebTest above), I assume that most of the Netbeans data will already be there.

If you are new to Maven, I suggest you browse the free pdf / html books on the Sonatype website.

+9
source share

All Articles