To create a WAR file for a Java web application in NetBeans 8.2
- In the NetBeans IDE select the Files tab,
- Right-click the pom.xml file and select Run Maven > Goals…
- In the Run Maven window enter compile war:war into the Goals field,
- Select the Remember as checkbox and enter Compile war for the name,
- The WAR file is generated in the target directory of the Java web project.
- The next time you want to build the WAR file, the Compile war option will be visible in the Run Maven menu.