Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I automatically export a WAR after Java build in Eclipse?

I have a J2EE project in Eclipse 3.2 and at the end of every build I want to automatically create and deploy a WAR file. At the moment I have to do this by hand which is 5 or 6 mouse-cliks and it would be nice to automate it.

I know I can do this with a custom build script using ANT but I am hoping for an Eclipse native solution.

I have the J2EE standard tools (JST) and Web Standard Tools (WST) plug-ins installed in my Eclipse environment.

like image 302
Simon Avatar asked Dec 07 '08 15:12

Simon


People also ask

How do I export a WAR file as a project?

Procedure. Right-click on a Web project folder and select Export from the pop-up menu. Then select WAR file in the Export window and then select Next. Specify the Web project you want to export (this field is primed if you used the pop-up menu to open the wizard), and specify a location for the new WAR file.

Where can I find WAR file in Eclipse?

right click in project > export > web project > . war Then copy the . war file into webapp directory of your apache tomcat. Show activity on this post.


1 Answers

If you can implement it as an Ant script, then you can have Eclipse invoke that Ant script on each build automatically (and inside the Eclipse environment). Use Project->Properties->Builders->Add->Ant Builder. Give that builder you custom Ant script and it will automatically be executed after the "normal" builders of your project.

like image 60
Bananeweizen Avatar answered Oct 24 '22 22:10

Bananeweizen