我一直在尝试从 Jenkins 启动一个测试应用程序。最初我从 Jar 文件启动 Jenkins,一切正常。
这是控制台输出:
Started by user ABC
Building in workspace C:\MyDir
[xyz] $ cmd /c call C:\Users\usrname\AppData\Local\Temp\hudson2329759222967199349.bat
...
现在,当我将 Jenkins 作为 Windows 服务启动时
Started by user ABC
Building in workspace C:\MyDIr
[xyz] $ cmd /c call C:\WINDOWS\TEMP\hudson4009309858990093371.bat
C:\MyDir>gauge specs
Failed to start gauge API: Plugin 'java' not installed on following locations : [C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\gauge\plugins]
为什么它从不同的临时文件夹运行它?我尝试通过将 AppData\Local\Temp 路径添加到 jenkins.xml 来纠正问题
<executable>java</executable>
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle
"-Dhudson.model.DirectoryBrowserSupport.CSP=sandbox allow-scripts; default-src 'self' 'unsafe-inline' ; img-src 'self'; style-src 'self' 'unsafe-inline';"
-Djava.io.tmpdir="C:/Users/username/AppData/Local/Temp"
-jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>
如果有帮助:Jenkins 安装在 C:\Users\username.jenkins Jenkins 页面只是拒绝加载。我该怎么办?