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.
palacsint
source share