gpt4 book ai didi

git - 在跟随 "gameoflife"by john ferguson 时在项目 "jenkins the definitive guide"的初始构建期间遇到问题

转载 作者:太空狗 更新时间:2023-10-29 14:44:04 26 4
gpt4 key购买 nike

我是一名初学者,试图通过遵循 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 .

https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/httpatomoreillycomsourceoreillyimages864759.png

确保您取消选择该选项,并引用已安装的 jdk 的路径(在遵循 Ferguson's example 之前)。

关于git - 在跟随 "gameoflife"by john ferguson 时在项目 "jenkins the definitive guide"的初始构建期间遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39162494/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com