License Public Domain
Lines 23
Keywords
ant (2) debug (6) tomcat (2)
Permissions
Viewable by Everyone
Editable by All Siafoo Users
Hide
Free your code from a slow death on your hard drive Join Siafoo Now or Learn More

Start, Stop, and Remote Debug Tomcat Ant Commands Atom Feed 0

In Brief This is originally based on Peter Thomas's script available on his blog, I wanted to repost it here because of how useful it is. Once you set the tomcat path you can do:... more
# 's
 1<project>
2
3 <property name="tomcat.home" value="/path/to/tomcat"/>
4
5 <target name="run">
6 <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true" classpathref="classpath">
7 <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
8 </java>
9 </target>
10
11 <target name="stop">
12 <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
13 <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
14 <arg line="stop"/>
15 </java>
16 </target>
17
18 <target name="debug">
19 <java jar="${tomcat.home}/bin/bootstrap.jar" fork="true" classpathref="classpath">
20 <jvmarg value="-Dcatalina.home=${tomcat.home}"/>
21 <jvmarg value="-Xdebug"/>
22 <jvmarg value="-Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=n"/>
23 </java>
24 </target>
25
26</project>

This is originally based on Peter Thomas's script available on his blog, I wanted to repost it here because of how useful it is. Once you set the tomcat path you can do:

ant run

ant stop

and the most useful:

ant debug

If you run ant debug, you can connect to it using Eclipse's Remote JVM Debugger (which is awesome when you can't run a server inside Eclipse).