Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy/import war package into Netbeans

I have looked through the help documentation in netbeans 6.5.1 but cannot find anything explicit explaining how to deploy/import a war package.

I know in Eclipse, it's as easy as right clicking in the Project Explorer >> select IMPORT >> WAR FILE.

However, I still am unable to find a solution for Netbeans.

Thankyou, Jordan

like image 313
Lycana Avatar asked May 31 '09 05:05

Lycana


People also ask

How do you deploy the WAR file?

Perhaps the simplest way to deploy a WAR file to Tomcat is to copy the file to Tomcat's webapps directory. Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it.

How do I import a folder into NetBeans?

Click on the arrow to the left of your package's name to expand the folder view. Right-click on the main project folder, then select "New," then "Other." Select "Other" from the file selection window, then select "Folder." Give your folder a name and click "Finish."


2 Answers

posted elsewhere, thought i might post here too.

after some googling I've found the solution and here are the steps:

(tested using apache's ode.war in NetBeans 8.0)

  1. unzip the war file
  2. in the unzipped folder, you will see WEB-INF/, META-INF/, etc., create a sub-folder named web in the unzipped folder.
  3. put everything else into web (now they will be web/WEB-INF/, web/js/, ...)
  4. go to netbeans, new project -> java web -> web application with existing sources
  5. pretty much just press next all the way through. voilà, it's done.
like image 60
Vince L Avatar answered Sep 22 '22 01:09

Vince L


I assume you don't already have an ant or maven project for your web project? If you did, you would just import a maven project or create a Web Free-Form Application and wire it up to your ant script.

I would unzip the war file, create a new web application with existing sources in netbeans and wire everything up using the wizard.

like image 42
Mike Cornell Avatar answered Sep 18 '22 01:09

Mike Cornell