How to use the open WAR folder in Netbeans

So, I was provided with a WAR file, but after downloading it, I noticed that this is actually a folder, not a WAR file. Trying to open this folder in Netbeans does not work, because it expects a war file, not a folder.

I tried to β€œwork out” the folder that worked. Netbeans can now open the file, however, none of the files can be edited.

+4
source share
2 answers

This has been tested with apache ode.war in NetBeans 8.0:

  • Unzip the war file
  • In the unpacked folder you will see WEB-INF /, META-INF / etc., create a subfolder named web in the unpacked folder.
  • Put everything else on the network (now they will be web / WEB -INF /, web / js /, ...)
  • Go to netbeans, new project -> java web application -> with existing sources
  • Pretty much just click on. that was done.
+4
source

If you do not have eclipse, just put the war file in the Tomcat webapps folder, go to the Tomcat bin folder and run startup . Tomcat will automatically extract a war file for you. Now go to the webapps folder and there you will find another folder with the same name as your war.

I could not find an option to import the war directly into Netbeans (strange. Perhaps someone could create this function and send it as a patch for Netbeans). The folder that is extracted to the Tomcat folder can be used as a Netbeans project. It is recommended that you first copy it to another folder. Import by File > New Project > Web application with existing sources .

Eclipse has the ability to export the war and include sources along with it, so it is likely that the source files will also enter the game.

+1
source

Source: https://habr.com/ru/post/1387650/


All Articles