How to integrate maven 2 in an existing netbeans project?
How to integrate mave开发者_C百科n 2 in an existing netbeans project ?
I dont want to do it by creating a new maven web app project and moving my files manually to the new project(as I have versions of this project in my subversion repositories which I wont be able to link if I create new project), rather I need to integrate that in my already existing netbeans project. How do I go about it ? Would creating a pom.xml work ?
Maven 2 already installed on my machine.
What about creating a new Maven Web Project and moving the pom.xml back to your existing Web Project? I mean:
- Backup your projects
- Create a new project with name
MavenWebTest - Close your original project
- Move the
pom.xmlfrom theMavenWebTestproject to your original project's folder - Modify the
pom.xml's project specific settings (e.g. project name, dependencies) - Delete the
build.xmland the wholenbprojectfolder - Move and rename the
webfolder tosrc/main/webapp(webappis the new name) (usesvn mvif you use Subversion) - Move
src/javatosrc/main/java(svn mvhere too) - Open you project again in Netbeans. It should be a Maven project now.
- Delete the unnecessary
MavenWebTestproject
Anyway, creating an empty pom.xml also should work. You have to list your dependencies in the pom.xml and you have to set the project's name. Maybe other fine tunings also required to get the same result as Netbeans create without Maven. If you create the pom.xml with Netbeans (the MavenWebTest above) I suppose that most of Netbeans specific stuff already will be there.
If you are new to Maven I suggest you to check the free pdf/html books on Sonatype's website.
加载中,请稍侯......
精彩评论