Can you publish a .war directly from eclipse to a web server.
I know it's not a programming question, but I still think it's a relevant question.
Thanks
Can you publish a .war directly from eclipse to a web server.
I know it's not a programming question, but I still think it's a relevant question.
Thanks
Yes, you do that
cd /home/alex/webapps/mywebapp jar cf ../mywebapp.war * - copy that war file to the following deploy directory in your server say in Jboss its like this "C:\Jboss405\server\default\deploy"
I hope this might be clear, else let me know any issues if you face any issues
Yes, but it depends a lot on your project configuration. Generally you need to define the server in eclipse, and choose "Run on Server".
See this as an example of deploying on JBoss server from eclipse.
In case you are using Ant then using "deploy" target will work.
If your project is setup as a web project in Eclipse, you can choose to run it on a server (You'll have to configure the server first). This will publish the war file directly on the server from Eclipse.
yes you can.
right click on the project, select export -> select web - > then war and give destination which is your deploy folder.
This is easiest if the web server has an auto-deploy facility, with a magic directory. Then just File-> Export the WAR file into the auto-deploy folder.
If not, or if you want to be able to debug the WAR file inside Eclipse you need to have an appropriate server connector in the WTP module (which is included by default in the JEE edition of Eclipse).
If you want to programmatically push the WAR file to a given server directly from within Eclipse, then you can e.g. 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 to do this with many different types of servers - http://cargo.codehaus.org/
I created my own ant file, and set eclipse to use that ant file when building. Part of that ant build file is a target that publishes to Tomcat, so I can just right click and chose install from within eclipse.
The basis of such an ant file is here: http://tomcat.apache.org/tomcat-6.0-doc/appdev/build.xml.txt