作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我是一名初学者,试图通过遵循 John Ferguson 的“Jenkins 权威指南”来学习 Jenkins。我已经从 github 下载了示例项目“gameoflife”,并为 Maven、Git 和 Java jdk 设置了初始配置。但是,当我第一次开始构建过程时,项目应该会通过。但我不断收到构建失败消息。因为我是 Jenkins 的新手,所以我不确定我做错了什么以及如何解决。
我在下面附上了失败消息的副本。
Started by an SCM change
Building in workspace C:\Users\Justin\.jenkins\workspace\gameoflife-default
Installing C:\Users\Justin\.jenkins\tools\hudson.model.JDK\jdk.exe
[hudson.model.JDK] $ C:\Users\Justin\.jenkins\tools\hudson.model.JDK\jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\Users\Justin\.jenkins\tools\hudson.model.JDK /L C:\Users\Justin\.jenkins\tools\install5268142390914952134log
java.io.IOException: Cannot run program "C:\Users\Justin\.jenkins\tools\hudson.model.JDK\jdk.exe" (in directory "C:\Users\Justin\.jenkins\tools\hudson.model.JDK"): CreateProcess error=740, The requested operation requires elevation
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:240)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at hudson.Launcher$ProcStarter.join(Launcher.java:388)
at hudson.tools.JDKInstaller.install(JDKInstaller.java:271)
at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:144)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:144)
at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:357)
at hudson.model.Run.getEnvironment(Run.java:2232)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1090)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 25 more
Archiving artifacts
ERROR: Failed to archive artifacts: **/target/*.jar
java.io.IOException: Unable to delete 'C:\Users\Justin\.jenkins\tools\hudson.model.JDK'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
at hudson.Util.deleteFile(Util.java:257)
at hudson.FilePath.deleteRecursive(FilePath.java:1231)
at hudson.FilePath.access$1000(FilePath.java:195)
at hudson.FilePath$14.invoke(FilePath.java:1201)
at hudson.FilePath$14.invoke(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1018)
at hudson.FilePath.act(FilePath.java:996)
at hudson.FilePath.deleteRecursive(FilePath.java:1198)
at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:133)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:144)
at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:357)
at hudson.model.Run.getEnvironment(Run.java:2232)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:234)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.nio.file.DirectoryNotEmptyException: C:\Users\Justin\.jenkins\tools\hudson.model.JDK
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
at java.nio.file.Files.deleteIfExists(Unknown Source)
at hudson.Util.tryOnceDeleteFile(Util.java:296)
at hudson.Util.deleteFile(Util.java:252)
... 26 more
Recording test results
ERROR: Step ‘Publish JUnit test result report’ aborted due to exception:
java.io.IOException: Unable to delete 'C:\Users\Justin\.jenkins\tools\hudson.model.JDK'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
at hudson.Util.deleteFile(Util.java:257)
at hudson.FilePath.deleteRecursive(FilePath.java:1231)
at hudson.FilePath.access$1000(FilePath.java:195)
at hudson.FilePath$14.invoke(FilePath.java:1201)
at hudson.FilePath$14.invoke(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1018)
at hudson.FilePath.act(FilePath.java:996)
at hudson.FilePath.deleteRecursive(FilePath.java:1198)
at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:133)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
at hudson.model.JDK.forNode(JDK.java:144)
at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:357)
at hudson.model.Run.getEnvironment(Run.java:2232)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:922)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:146)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.nio.file.DirectoryNotEmptyException: C:\Users\Justin\.jenkins\tools\hudson.model.JDK
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
at java.nio.file.Files.deleteIfExists(Unknown Source)
at hudson.Util.tryOnceDeleteFile(Util.java:296)
at hudson.Util.deleteFile(Util.java:252)
... 26 more
Finished: FAILURE
最佳答案
相关的错误信息是
Cannot run program "C:\Users\Justin\.jenkins\tools\hudson.model.JDK\jdk.exe"
(in directory "C:\Users\Justin\.jenkins\tools\hudson.model.JDK"):
CreateProcess error=740, The requested operation requires elevation
at java.lang.ProcessBuilder.start(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=740,
The requested operation requires elevation
at java.lang.ProcessImpl.create(Native Method)
调用栈涉及
hudson.tools.JDKInstaller.install
尝试检查 Jenkins 的配置,并检查是否有 "Install automatically" selected in either your job or in Jenkins "Configure System" main settings section .
确保您取消选择该选项,并引用已安装的 jdk 的路径(在遵循 Ferguson's example 之前)。
关于git - 在跟随 "gameoflife"by john ferguson 时在项目 "jenkins the definitive guide"的初始构建期间遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39162494/
我是一名初学者,试图通过遵循 John Ferguson 的“Jenkins 权威指南”来学习 Jenkins。我已经从 github 下载了示例项目“gameoflife”,并为 Maven、Git
我是一名优秀的程序员,十分优秀!