直接 CMD 使用 windows 批处理命令执行以下,是可以正常启动 tomcat

set TOMCAT_HOME=C:\Apps\apache-tomcat-7.0.62-8070
set TOMCAT_BIN=%TOMCAT_HOME%\bin
cd /d %TOMCAT_BIN%
call startup.bat

但是以上批处理命令在 jenkins 自定义任务下执行后,
tomcat 服务是可以正常启动的,但是是交互式服务隐藏启动的,有没有遇到过相同问题,有办法可以正常 GUI 启动的

由用户 unknown or anonymous 启动
[EnvInject] - Loading node environment variables.
在 master 上构建 在工作空间 C:\Program Files (x86)\Jenkins\workspace\AA 中
[AA] $ cmd /c call C:\Users\ZR06\AppData\Local\Temp\jenkins4769581628368064466.bat

C:\Program Files (x86)\Jenkins\workspace\AA>set TOMCAT_HOME=C:\Apps\apache-tomcat-7.0.62-8070 

C:\Program Files (x86)\Jenkins\workspace\AA>set TOMCAT_BIN=C:\Apps\apache-tomcat-7.0.62-8070\bin 

C:\Program Files (x86)\Jenkins\workspace\AA>cd /d C:\Apps\apache-tomcat-7.0.62-8070\bin 

C:\Apps\apache-tomcat-7.0.62-8070\bin>call startup.bat 
Using CATALINA_BASE:   "C:\Apps\apache-tomcat-7.0.62-8070"
Using CATALINA_HOME:   "C:\Apps\apache-tomcat-7.0.62-8070"
Using CATALINA_TMPDIR: "C:\Apps\apache-tomcat-7.0.62-8070\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_144"
Using CLASSPATH:       "C:\Apps\apache-tomcat-7.0.62-8070\bin\bootstrap.jar;C:\Apps\apache-tomcat-7.0.62-8070\bin\tomcat-juli.jar"
Process leaked file descriptors. See https://jenkins.io/redirect/troubleshooting/process-leaked-file-descriptors for more information
Finished: SUCCESS


↙↙↙阅读原文可查看相关链接,并与作者交流