【发布时间】:2017-12-11 09:38:05
【问题描述】:
我在 jenkins 的 /home/tes/pom.xml 中的 pom.xml 上运行 maven clean test 时遇到权限被拒绝的问题。任何建议
Building in workspace /var/lib/jenkins/workspace/jenkins
[jenkins] $ /usr/share/maven/bin/mvn -f /home/tes/pom.xml clean test
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (/home/tes/pom.xml) has 1 error
[ERROR] Non-readable POM /home/tes/pom.xml: /home/tes/pom.xml (Permission denied)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
【问题讨论】:
-
检查 pom.xml 等文件的权限
-
您必须至少授予用户“读取”权限,该用户在机器上运行 jenkins 作业 - 例如。
sudo chmod -R +r, chmod -R +r /home/tes/也许还有 +x 权限,我不确定可能更正确的方法是在机器上创建一些用户组并为每个组设置权限