Two Methods for starting and stopping tomcat in the ant script

Source: Internet
Author: User
  1. <P>
  2. 1. display the Tomcat console interface in the Windows command line window </P> <p> </P>
[HTML]View plaincopy
  1. <Property name = "tomcat. Home" value = "D: \ developer \ apache-Tomcat-6.0.32"/>
  2. <Target name = "stop_tomcat">
  3. <Echo> stop Tomcat </echo>
  4. <Exec executable = "cmd" dir = "$ {tomcat. Home}/bin" failonerror = "false"
  5. Output = "$ {log. File}" APPEND = "true">
  6. <! -- <Arg value = "/C"/> -->
  7. <Env key = "catalina_home" Path = "$ {tomcat. Home}"/>
  8. <Arg value = "/C shutdown. Bat"/>
  9. </Exec>
  10. </Target>
  11. <Target name = "start_tomcat">
  12. <Echo> start Tomcat </echo>
  13. <Exec executable = "cmd" dir = "$ {tomcat. Home}/bin" failonerror = "false"
  14. Output = "$ {log. File}" APPEND = "true">
  15. <! -- <Arg value = "/C"/> -->
  16. <Env key = "catalina_home" Path = "$ {tomcat. Home}"/>
  17. <Arg value = "/C startup. Bat"/>
  18. </Exec>
  19. </Target>


 

Log. file is a file created in the previous target, used to output the Tomcat Start and Stop information.

 

Second, display the Tomcat console information in the eclipse Console

[HTML]View plaincopy
    1. <Target name = "tomcat. Start">
    2. <Java jar = "$ {tomcat. Home}/bin/Bootstrap. Jar" fork = "true">
    3. <Jvmarg value = "-dcatalina. Home =$ {tomcat. Home}"/>
    4. </Java>
    5. </Target>
    6. <Target name = "tomcat. Stop">
    7. <Java jar = "$ {tomcat. Home}/bin/Bootstrap. Jar" fork = "true">
    8. <Jvmarg value = "-dcatalina. Home =$ {tomcat. Home}"/>
    9. <Arg line = "stop"/>
    10. </Java>
    11. </Target>
    12. <Target name = "tomcat. debug">
    13. <Java jar = "$ {tomcat. Home}/bin/Bootstrap. Jar" fork = "true">
    14. <Jvmarg value = "-dcatalina. Home =$ {tomcat. Home}"/>
    15. <Jvmarg value = "-xdebug"/>
    16. <Jvmarg value = "-xrunjdwp: Transport = dt_socket, address = 8000, Server = Y, suspend = N"/>
    17. </Java>
    18. </Target>

Two Methods for starting and stopping tomcat in the ant script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.