Posted By:
Anonymous
Posted On:
Wednesday, October 24, 2007 03:14 AM
hi friends, i want to create a utility that should support deployment,update,undeployment of war files without restarting the webservers[all tomcat,weblogic,webspire etc]. i want to it programatically.For time being i have used org.apache.tools.ant.task, org.apache.tools.ant.Project in my program.[using ant tool, ant.jar] it works fine for tomcat. i want to know whteher it should support all other webserver. the way i am handling this problem is correct? this is my code import org.apache.tools.ant.Project; import org.apache.tools.ant.Target; import org.apache.tools.ant.taskdefs.Expand; impor
More>>
hi friends,
i want to create a utility that should support
deployment,update,undeployment of war files without
restarting the webservers[all tomcat,weblogic,webspire etc].
i want to it programatically.For time being i have used
org.apache.tools.ant.task,
org.apache.tools.ant.Project in my program.[using ant
tool, ant.jar]
it works fine for tomcat. i want to know whteher it should
support all other webserver. the way i am handling this problem is correct?
this is my code
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.taskdefs.Expand;
import java.io.File;
public class Deploy{
static Deploy de;
Project project;
Expand expander;
Target target;
Deploy(){
project = new Project();
project.init();
target = new Target();
}
public static void main(String a[]){
de = new Deploy();
de.deployWar();
}
public void deployWar() {
try{
Expand expander = new Expand();
expander.setProject(project);
expander.setSrc(new File("e:\mywar.war"));//source war file
expander.setDest(new File("E:\mani\apache-tomcat-5.5.25\webapps\mywar")); //destination place to deploy
expander.execute();
}
catch (Exception e){
System.out.println("Exception" + e.toString());
}
}
}
<<Less