Reputation: 1
I have a Maven Java web project opened with NetBeans. The goal is to run and deploy the project on Tomcat from NetBeans by for example clicking on the green play button (like other IDEs).
Should I tweak my maven pom.xml? (All the solution that I could find was related to old NetBeans and Tomcat.)
Upvotes: 0
Views: 330
Reputation: 6045
Open the "Service" view (CTRL+5), right click on the "Servers" node and "Add Server". After you configured your Tomcat server switch back to the "Projects" view (CTRL+1), open the "Project Properties" (right click on the project root node, then "Properties") and in the category "Run" you can select now the server you just configured and on which the project should get deployed on. You still need to set your project as the main project ("Run / Set Main Project") and now you can deploy your project with the play button / F6.
NetBeans will create a nb-configuration.xml in the root folder of your project to store those information. You might want to exclude this file from version control. (If you are the only developer there's no harm in including it).
Upvotes: 1