How can I create a war file of my project in NetBeans?
Right click your project, hit "Clean and Build". Netbeans does the rest.
under the dist directory of your app, you should find a pretty looking .war all ready for deployment.
I had to right-click the build.xml file and choose "run". Only then would the .war file be created.
Simplest way is to Check the Output - Build tab: It would display the location of war file.
It will have something like:
Installing D:\Project\target\Tool.war to C:\Users\myname.m2\repository\com\tool\1.0\Tool-1.0.war
If NetBeans haven't created your dist
folder, execute the do-dist
ant target:
In commandline navigate to the directory of your project, the one containing a build.xml file
> ant do-dist
If ant runs fine (most likely), your dist
folder will be created, containing the .war
file.