RSS Feed Subscribe to RSS Feed

 

Ant build file to redeploy to Tomcat

Here is an example of an ant file that redeploys a web project to tomat. The neat thing is that as well as creating the war file, it also stops and restarts tomcat, all from ant.
I have found myself rewriting variations of this on a couple of projects recently, so I thought it was worth posting…
(Note it doesn’t include a compile target as I am doing it from my IDE)



	

	
		
			
			
		
	
	
	
		
		
	

	
		
			
			
					
			
		
	 

	
		
			
		
	

	
		    


And here is an example of the associated build.properties file


	tomcat.home=C:/Program Files/Apache/tomcat
	project.name=SampleProjectName
	project.warfilename={project.name}.war
	project.deploywar=${tomcat.home}/webapps/${project.name}.war
	project.deploydir=${tomcat.home}/webapps/${project.name}

Tags: ,

Leave a Reply