Skip to content

Instantly share code, notes, and snippets.

@sergnechaev
Created October 13, 2015 12:31
Show Gist options
  • Save sergnechaev/9614cdeffc6757e63e4a to your computer and use it in GitHub Desktop.
Save sergnechaev/9614cdeffc6757e63e4a to your computer and use it in GitHub Desktop.
Tomcat start/stop/application hot-deployment - ANT script
<?xml version="1.0" encoding="UTF-8"?>
<project name="my project" default="copyStatic">
<property name="INSTALL_ROOT" value="s:/tools/apache-tomcat-8.0.3/webapps/myproject" />
<property name="tomcat.home" value="s:/tools/apache-tomcat-8.0.3" />
<target name="copyStatic">
<copy todir="${INSTALL_ROOT}/" verbose="true">
<fileset dir="src/main/webapp"/>
</copy>
<copy todir="${INSTALL_ROOT}/WEB-INF/classes" verbose="true">
<fileset dir="target/classes"/>
</copy>
</target>
<target name="start_tomcat">
<exec dir="${tomcat.home}/bin/" executable="${tomcat.home}/bin/s.bat" spawn="true" />
</target>
<target name="stop_tomcat">
<exec dir="${tomcat.home}/bin/" executable="${tomcat.home}/bin/shutdown.bat" spawn="true" />
</target>
<target name="wipe out">
<delete dir="${INSTALL_ROOT}"/>
<mkdir dir="${INSTALL_ROOT}"/>
</target>
<target name="z_re-create db">
<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/qa?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8&amp;characterSetResults=utf8&amp;connectionCollation=utf8_unicode_ci"
userid="root"
password=""
classpath="./misc/db/com.springsource.com.mysql.jdbc-5.1.6.jar"
>
drop database IF EXISTS qa;
create database qa CHARACTER SET utf8 COLLATE utf8_unicode_ci;
grant all privileges on qa.* to qa_user@localhost identified by 'qa_123_qa_1';
grant all privileges on qa.* to qa_user@'127.0.0.1' identified by 'qa_123_qa_1';
FLUSH PRIVILEGES;
</sql>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment