Can you publish .war directly from eclipse to a web server?

Can you publish .war directly from eclipse to the web server.

I know this is not a programming issue, but I still think it is a relevant question.

thanks

+4
source share
7 answers

Yes, you can.

right-click on the project, select export โ†’ select web โ†’ then war and specify the destination that is your deployment folder.

+4
source

Yes, but it depends on the configuration of your project. Typically, you need to define a server in eclipse and select "Run on server".

See this as an example of deployment to eclipse's JBoss server.

If you use Ant, then using the "deploy" target will work.

+3
source

If your project is configured as a web project in Eclipse, you can run it on the server (you need to configure the server first). This will publish the war file directly on the server from Eclipse.

+1
source

This is easiest if the web server has an automatic deployment tool with a magic directory. Then just File-> Export the WAR file to the automatic deployment folder.

If not, or if you want to be able to debug a WAR file inside Eclipse, you need to have the appropriate server connector in the WTP module (which is enabled by default in the Java EE Eclipse editor).

If you want to programmatically push a WAR file to a given server directly from Eclipse, you can, for example, use the Tomcat Ant tasks - http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Executing%20Manager% 20Commands% 20With% 20Ant - or use the Cargo library for this with many different types of servers - http://cargo.codehaus.org/

+1
source

This should be pretty easy:

  • Import the war file into eclipse. File> Import ...> Web> WAR file. (probably only works on eclipse for java ee development)

  • Select a war file, create a new project (any new name works), click "Finish"

  • Add a new project to your server

  • Blam!

+1
source

I created my own ant file and installed eclipse to use this ant file when creating. Part of this ant build file is the target that Tomcat publishes, so I can just right-click and choose the installation from the eclipse.

Eclipse pic http://img408.imageshack.us/img408/6701/eclipseant.png

The basis of such an ant file is here: http://tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt

0
source

Yes you do it

  • Run the build application
  • Create a war file A WAR file (or "web archive") is just a packaged webapp directory. It is created using the standard Java jar tool. For instance:

cd / home / alex / webapps / mywebapp jar cf ../ mywebapp.war * - copy this war file to the following deployment directory on your server say in Jboss, like " C: \ Jboss405 \ server \ default \ Deploy"

I hope this can be clear, otherwise let me know any problems if you encounter any problems.

-3
source

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


All Articles