How to use local tomcat? and do deployment on remote server?

How to build and deploy war file on local tomcat and start?

Is the tomcat needs to be downloaded each time the build is run? and

what if i have to deploy my application on remote server’s tomcat?

Also one more question :slight_smile: how to deploy in expolded format on local?

To answer your question, I’d need to know your specific requirements in more detail.

  1. Do you want/prefer to use an embedded container implementation for a local deployment? 2) How do you define the process of deploying an application to a remote Tomcat server? Is it basically just hot deployment of a WAR file or do you need other other operations to be applied?

Hi Benjamin, Thanks for your interest in my question. Basically i want to achieve full automation related to build and deploy of the application.

  1. I prefer local deployment on tomcat to embedded one because in future i may need to use application server like JBoss.So today if i am deploying on local non-embedded server it will be easier to switch. For development on any other server.

Also there will be other applications running in the same context.

  1. Along with deploying my war file to remote server.The deployment would mainly constitute some tasks like

i) deploy the war file to the remote directory(server may be JBoss)

ii) take backup of the existing WAR file and other configuration related files

iii) update few xml files for Datasource,spirng wiring,logging levels related entries.

iv) take backup of the server log files by zipping and then SFTP to local dir.( i am trying to figure out how to use the credentials for logging in into the remote serve as we do in ANT)

v) also the execution of sever startup and shutdown commands(windows, UNIX)

Although the Embedded tomcat is a nice fast process to develop and test, But i want more control of the build process.And one major reason is i don’t know how the embedded one works and how to customize.

For local deployment, I’d recommend having a look at the Cargo plugin. It allows for using the same logic and DSL for a whole variety of application servers and servlet containers which makes switching between containers very easy. You could even have dedicated deployment tasks for different containers.

For remote deployment, you will need to write your own build logic. Have a look at the SSH plugin for implementing the tasks you mentioned above. I am not aware of any other plugin that allows for executing remote commands on Windows. For course you could also wrap existing SSH/SCP Ant tasks from Gradle.

There are other tools (GLU, Fabric…) that specialize in modeling a deployment workflow. You might want to look into those as well.

Thanks for the Information Benjamin. I am now trying my hand on these.