'How to build a web project with existing sources without Tomcat in Netbeans?

How do I build a WAR file from existing Java web project sources without a local Tomcat installation in Netbeans 13?

I have received an old Java Web project for Tomcat and I need to do a small code change and build a WAR file. The instructions in the project readme file are straightforward:

  • File->New Project
  • Java Web->Web application with Existing Sources
  • Choose the source folder & Next, Next, Finish

However, the instructions seem to be coming from older Netbeans (version 8). I have Netbeans 13.

At first, I got stuck because there is no "Java Web" at the Categories root. There is only Java with Ant (my project doesn't even have ant build files), and it has Java Web->Web application with Existing Sources under it. I filled in all the paths, so far so good.

But then I got stuck at this window where it asks for server settings. I don't want Netbeans to connect to any server immediately, I just need to build a WAR, and then I'll deploy it to remote Tomcat manually. From older Oracle documentation, this step should be optional but I cannot skip it. Is it really mandatory?

Netbeans server settings



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source