This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes How to deploy WAR to Tomcat (which is server into Eclipse) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to deploy WAR to Tomcat (which is server into Eclipse)" Watch "How to deploy WAR to Tomcat (which is server into Eclipse)" New topic
Author

How to deploy WAR to Tomcat (which is server into Eclipse)

Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
Hi All,

We need to customised our war file and we need to deploy it into our tomcat which is part of development. We have tomcat as part of Eclipse (server>new server). In normal circumstances, project is auto deploy to tomcat, but how to deploy customised war file to it.


Thanks & Regards,
Nitesh
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Are you using ANT or Maven at all? Or are you asking which folder the WAR needs to be copied into?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Or are you doing this entirely in Eclipse (in which case this is the wrong forum and we will move your post for you).


JBoss In Action
Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
Hi Peter/Martijn,

We are trying to customized our development environment. Normally, when we have "dynamic web proj" in eclipse, it is automaticall deploy to local server. What we want to do is, when developer invoke particular task into his dev environment, it will compile, copy/move some files (like .properties file, img files,xml) to required directory structure and deploy it to local tomcat (of eclipse). Same way, developer, invoke particular task (different then the above), it will do the same thing, but generate war file which he can deploy to standalone server for further testing. We also like to add some task for testing different modules and make them part of deployment/war generation process.

Regards,
Nitesh
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Here is what we do.

First, Eclipse is a development environment. Each developer uses Eclipse and does development and testing in what ever way works best for them, including deploying to their local app server.

Once code is written, tested and meets our various coding guidelines, the developer checks the changes into a central source code repository.

Then a continuous integration service (Hudson) does a build and test and deploys to a system test machine. There is another automated process that on a push-button deploys the app to production. In all cases, we use Maven and/or Ant to do our builds, testing and deployment.

We NEVER deploy from Eclipse into either the system/integration test or production environment - that is just asking for trouble.

(Your original post might have been Eclipse centric, but notice how I deftly turned it into an Ant/Maven-centric post! )
Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
Peter,

I agreed with you regarding automation for testing deployment on different server. But we are still in initial stage and our current requirent is not that much (or we cann't afford that number of servers). Basically, we have to follow slightly different directory structures like seperate location for label properties file, seperate location for error message properties file, seperate location for config properties files etc. If we follow default structure of "dynamic web project" then we must have to put files at their repsective location. If we can tweak it then it is more better and helpful for team to manage.

That's reason, we need to make custom build in Dev environment so when developer build, it will move/copy files from respective location and generate required deployment structure into local server.

Regards,
Nitesh
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

When running you web application from inside Eclipse - it runs in your local Tomcat server (not located inside Eclipse).

If you know how a WAR file look like inside, then you just have to build it with maven and/or ant, and then deploy it in your local Tomcat server - now how or where is a WAR deployed inside Tomcat ?? - hint: look in the root of your local tomcat, and there you should find a 'webapps' folder.

Here you can read about how you deploy on Tomcat: http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to deploy WAR to Tomcat (which is server into Eclipse)
 
Similar Threads
Eclipse Doubt
Tomcat 6.0.30: cannot deploy application: access denied.
cant search portlet in my jetspeed
how to create a war file in eclipse2.1 to deploy in tomcat 5.5
Using Jboss in development Environment