在Jenkins中运行构建时不可读的POM(权限被拒绝) [英] Non-readable POM (Permission denied) when running build in Jenkins

查看:231
本文介绍了在Jenkins中运行构建时不可读的POM(权限被拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MAC操作系统.当我尝试在Jenkins中运行测试项目的新版本时,在控制台中出现此错误:

Using MAC os.When I try to run a new build for test project in Jenkins, I got this error in the console:

[INFO] Scanning for projects...
12:32:26 [ERROR] [ERROR] Some problems were encountered while 
processing the POMs:
12:32:26 [FATAL] Non-readable POM 
/Users/****/pom.xml: 
/Users/****/pom.xml 
(Permission denied) @ 

我将pom.xml文件的权限设置为777.这是我的POM.xml,其中包含以下内容:

I give my pom.xml file permissions 777. Here is my POM.xml, which consist of the following:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>HybridMavenProject</groupId>
<artifactId>Learning_Selenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
    </configuration>
  </plugin>
 </plugins>
 </build>
 <dependencies>
 <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.6.0</version>
</dependency>
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.17</version>
</dependency>
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.11</version>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.17</version>
</dependency>
<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20.1</version>
</dependency>
</dependencies>
</project>

在Jenkins中也进行构建,我为我的POM提供了确切的路径

Also in Jenkins for the Build I give exact path for my POM

推荐答案

为USER:谁在Jenkins主/从代理中运行作业提供对jenkins作业/工作区文件夹的777权限.

Give 777 permission to jenkins jobs/workspace folder for USER: who is running jobs in Jenkins master/slave agent.

我有一个类似的错误,Jenkins无法解析pom.xml并创建目录.作为权限被拒绝的错误,所以我检查了jenkins代理中的/var/jenkins_home/JOBS文件夹,因此对USER的权限是只读的,因此我从根目录授予了对该文件夹的写入和执行权限,因此我能够构建工作.

I have a similar error, where Jenkins is not able to parse pom.xml and create dir. as permission denied error, so i have checked /var/jenkins_home/JOBS folder in jenkins agent, so the permission to USER is read only, so i have given write and execute permission to that folder from root, and so i am able to build jobs.

这篇关于在Jenkins中运行构建时不可读的POM(权限被拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆