免费家具网站模板,做网站去什么公司好,新闻类网站开发多久,涪陵网站建设公司前序#xff1a; 最近产品要release#xff0c;一直忙着测试#xff0c;没有时间学习ant了#xff0c;今天终于没什么事了赶紧写点东西。这个启动tomcat是好些天之前写的了。在这里跟大家分享一下。 build.xml ?xml version1.0? project name… 前序 最近产品要release一直忙着测试没有时间学习ant了今天终于没什么事了赶紧写点东西。这个启动tomcat是好些天之前写的了。在这里跟大家分享一下。 build.xml ?xml version1.0? project nameForTest defaultstart_tomcat property filebuild.properties/property target namestop_tomcat echo停止tomcat/echo exec executablecmd dir${tomcat.home}/bin failοnerrοrfalse output${log.file} appendtrue !-- arg value/c / -- env keyCATALINA_HOME path${tomcat.home}/ arg value/c/ arg valueshutdown.bat/ /exec /target target namestart_tomcat dependsstop_tomcat echo启动tomcat/echo exec executablecmd dir${tomcat.home}/bin failοnerrοrfalse output${log.file} appendtrue !-- arg value/c / -- env keyCATALINA_HOME path${tomcat.home}/ arg value/c startup.bat / /exec /target /project build.properties tomcat.homeG:\\apache-tomcat-7.0.42-windows-x64\\apache-tomcat-7.0.42 注意几点 exec executablecmd这一句是用在window系统下用cmd的方式启动tomcat。 env keyCATALINA_HOME path${tomcat.home}/必须指明CATALINA_HOME的值。 env是ant的数据类型参考http://www.cnblogs.com/xionghui/archive/2012/03/13/2393679.html /c的解释参考ant api Windows Users The exec task delegates to Runtime.exec which in turn apparently calls ::CreateProcess. It is the latter Win32 function that defines the exact semantics of the call. In particular, if you do not put a file extension on the executable, only .EXE files are looked for, not .COM, .CMD or other file types listed in the environment variable PATHEXT. That is only used by the shell. Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd using the /c switch. target namehelpexec executablecmdarg value/c/arg valueant.bat/arg value-p//exec
/targetA common problem is not having the executable on the PATH. In case you get an error message Cannot run program ...:CreateProcess error2. The system cannot find the path specified. have a look at your PATH variable. Just type the command directly on the command line and if Windows finds it, Ant should do it too. (Otherwise ask on the user mailinglist for help.) If Windows can not execute the program add the directory of the program to the PATH (set PATH%PATH%;dirOfProgram) or specify the absolute path in the executable attribute in your buildfile. 转载于:https://www.cnblogs.com/QAZLIU/p/3732273.html