• <bdo id='xA7Fj'></bdo><ul id='xA7Fj'></ul>

    1. <small id='xA7Fj'></small><noframes id='xA7Fj'>

    2. <legend id='xA7Fj'><style id='xA7Fj'><dir id='xA7Fj'><q id='xA7Fj'></q></dir></style></legend>
    3. <tfoot id='xA7Fj'></tfoot>
      <i id='xA7Fj'><tr id='xA7Fj'><dt id='xA7Fj'><q id='xA7Fj'><span id='xA7Fj'><b id='xA7Fj'><form id='xA7Fj'><ins id='xA7Fj'></ins><ul id='xA7Fj'></ul><sub id='xA7Fj'></sub></form><legend id='xA7Fj'></legend><bdo id='xA7Fj'><pre id='xA7Fj'><center id='xA7Fj'></center></pre></bdo></b><th id='xA7Fj'></th></span></q></dt></tr></i><div id='xA7Fj'><tfoot id='xA7Fj'></tfoot><dl id='xA7Fj'><fieldset id='xA7Fj'></fieldset></dl></div>

      1. 无法运行程序“mvn"错误=2,没有这样的文件或

        时间:2023-07-28

            <tbody id='Bv8Z2'></tbody>
          1. <legend id='Bv8Z2'><style id='Bv8Z2'><dir id='Bv8Z2'><q id='Bv8Z2'></q></dir></style></legend>

              <bdo id='Bv8Z2'></bdo><ul id='Bv8Z2'></ul>
            • <tfoot id='Bv8Z2'></tfoot>

              <small id='Bv8Z2'></small><noframes id='Bv8Z2'>

                • <i id='Bv8Z2'><tr id='Bv8Z2'><dt id='Bv8Z2'><q id='Bv8Z2'><span id='Bv8Z2'><b id='Bv8Z2'><form id='Bv8Z2'><ins id='Bv8Z2'></ins><ul id='Bv8Z2'></ul><sub id='Bv8Z2'></sub></form><legend id='Bv8Z2'></legend><bdo id='Bv8Z2'><pre id='Bv8Z2'><center id='Bv8Z2'></center></pre></bdo></b><th id='Bv8Z2'></th></span></q></dt></tr></i><div id='Bv8Z2'><tfoot id='Bv8Z2'></tfoot><dl id='Bv8Z2'><fieldset id='Bv8Z2'></fieldset></dl></div>
                • 本文介绍了无法运行程序“mvn"错误=2,没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在我的 Ubuntu 14.04 LTS 上进行构建,但得到以下结果:

                  I'm doing a build on my Ubuntu 14.04 LTS but I'm getting the following:

                  Started by user anonymous
                  Building in workspace /var/lib/jenkins/workspace/videovixx
                   > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
                  Fetching changes from the remote Git repository
                   > /usr/bin/git config remote.origin.url https://bitbucket.org/mdennis10/videovixx.git #     timeout=10
                  Fetching upstream changes from https://bitbucket.org/mdennis10/videovixx.git
                   > /usr/bin/git --version # timeout=10
                  using .gitcredentials to set credentials
                   > /usr/bin/git config --local credential.helper store --    file=/tmp/git6236060328558794078.credentials # timeout=10
                   > /usr/bin/git fetch --tags --progress https://bitbucket.org/mdennis10/videovixx.git   +refs/heads/*:refs/remotes/origin/*
                   > /usr/bin/git config --local --remove-section credential # timeout=10
                   > /usr/bin/git rev-parse refs/remotes/origin/master^{commit} # timeout=10
                   > /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
                  Checking out Revision f5c53e95d33c1e15abd7519346c18ec6bc0c81d7      (refs/remotes/origin/master)
                   > /usr/bin/git config core.sparsecheckout # timeout=10
                   > /usr/bin/git checkout -f f5c53e95d33c1e15abd7519346c18ec6bc0c81d7
                   > /usr/bin/git rev-list f5c53e95d33c1e15abd7519346c18ec6bc0c81d7 # timeout=10
                  [videovixx] $ mvn install package
                  FATAL: command execution failed
                  java.io.IOException: Cannot run program "mvn" (in directory    "/var/lib/jenkins/workspace/videovixx"): error=2, No such file or directory
                      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
                      at hudson.Proc$LocalProc.<init>(Proc.java:244)
                      at hudson.Proc$LocalProc.<init>(Proc.java:216)
                      at hudson.Launcher$LocalLauncher.launch(Launcher.java:802)
                      at hudson.Launcher$ProcStarter.start(Launcher.java:380)
                      at hudson.Launcher$ProcStarter.join(Launcher.java:387)
                      at hudson.tasks.Maven.perform(Maven.java:328)
                      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
                      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
                      at hudson.model.Build$BuildExecution.build(Build.java:199)
                      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
                      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
                      at hudson.model.Run.execute(Run.java:1745)
                      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
                      at hudson.model.ResourceController.execute(ResourceController.java:89)
                      at hudson.model.Executor.run(Executor.java:240)
                  Caused by: java.io.IOException: error=2, No such file or directory
                      at java.lang.UNIXProcess.forkAndExec(Native Method)
                      at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
                      at java.lang.ProcessImpl.start(ProcessImpl.java:130)
                      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
                      ... 15 more
                  Build step 'Invoke top-level Maven targets' marked build as failure
                  Archiving artifacts
                  Recording test results
                  Finished: FAILURE
                  

                  我假设这是由某些 linux 安全功能引起的,该功能阻止/var/lib/jenkins/workspace/videovixx 在没有正确权限的情况下创建我可能没有.这是问题吗?我该如何解决?

                  I'm assuming that this caused by some linux security feature that stops the /var/lib/jenkins/workspace/videovixx from being created without the correct permissions which I might not have. Is this the problem and how do I solve it?

                  推荐答案

                  这里有很多东西.

                  您要么没有在作业配置中选择 Maven 版本.或者你没有配置 Jenkins 来安装 Maven 版本.或者你希望在 Slave 上使用本地安装的 Maven,但它没有为 jenkins 用户配置.

                  You either didn't select Maven version in Job configuration. Or you didn't configure Jenkins to install a Maven version. Or you expected to use locally installed Maven on the Slave, but it's not configured for jenkins user.

                  由于我不知道你配置了什么(或没有配置)以及你期望使用什么,我无法直接回答,但我可以解释它是如何工作的.

                  Since I don't know what you've configured (or didn't configure) and what you expected to use, I can't answer directly, but I can explain how it works.

                  • 您必须在本地安装 Maven
                  • 您必须能够使用 jenkins 用户启动它
                  1. 执行sudo jenkins,然后在你的Slave上执行mvn验证jenkins用户是否可以运行mvn
                  2. 如果失败,您需要正确安装/配置 Maven
                  1. Execute sudo jenkins, and then execute mvn on your Slave to verify that jenkins user can run mvn
                  2. If that fails, you need to properly install/configure Maven

                • 在作业配置中,对于 Maven 版本,您必须选择 Default.这是使用本地安装在节点上的版本的设置
                • In Job configuration, for Maven Version, you must select Default. This is the setting that uses the version that's installed locally on the node
                  • 您必须转到 Jenkins 全局工具配置,并使用自动安装程序(来自网络)配置 Maven 版本.
                  • 在作业配置中,对于 Maven 版本,您必须选择您刚刚配置的那个特定版本.

                  这篇关于无法运行程序“mvn"错误=2,没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:禁止基于 Maven 的持续集成构建的 GPG 签名 (Travi 下一篇:如何使用 Travis CI 上的构建矩阵设置运行 API 25 的

                  相关文章

                  最新文章

                • <tfoot id='2oqni'></tfoot>
                  1. <legend id='2oqni'><style id='2oqni'><dir id='2oqni'><q id='2oqni'></q></dir></style></legend>

                        <bdo id='2oqni'></bdo><ul id='2oqni'></ul>

                      <small id='2oqni'></small><noframes id='2oqni'>

                      <i id='2oqni'><tr id='2oqni'><dt id='2oqni'><q id='2oqni'><span id='2oqni'><b id='2oqni'><form id='2oqni'><ins id='2oqni'></ins><ul id='2oqni'></ul><sub id='2oqni'></sub></form><legend id='2oqni'></legend><bdo id='2oqni'><pre id='2oqni'><center id='2oqni'></center></pre></bdo></b><th id='2oqni'></th></span></q></dt></tr></i><div id='2oqni'><tfoot id='2oqni'></tfoot><dl id='2oqni'><fieldset id='2oqni'></fieldset></dl></div>