【发布时间】:2020-12-16 04:52:25
【问题描述】:
我正在尝试在我的 Jenkins 中运行从 https://github.com/kishancs2020/TicketBookingServiceJunitTesting Github 获取的源代码,以查看在源代码的 Jenkinsfile 中创建的管道。
我已经更新了 maven,java 版本来修复它,但错误仍然是一样的。我也浏览了这个链接 http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException 但找不到解决方案。任何修复此错误的建议。
+ mvn clean -f TicketBookingServiceJunitTesting
POM file TicketBookingServiceJunitTesting specified with the -f/--file command line argument does not exist
[[1;34mINFO[m] Scanning for projects...
[[1;31mERROR[m] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /var/lib/jenkins/workspace/ervicejunittesting-master_master/TicketBookingServiceJunitTesting: /var/lib/jenkins/workspace/ervicejunittesting-master_master/TicketBookingServiceJunitTesting (No such file or directory) @
@
[[1;31mERROR[m] The build could not read 1 project -> [1m[Help 1][m
[[1;31mERROR[m]
[[1;31mERROR[m] The project (/var/lib/jenkins/workspace/ervicejunittesting-master_master/TicketBookingServiceJunitTesting) has 1 error
[[1;31mERROR[m] Non-readable POM /var/lib/jenkins/workspace/ervicejunittesting-master_master/TicketBookingServiceJunitTesting: /var/lib/jenkins/workspace/ervicejunittesting-master_master/TicketBookingServiceJunitTesting (No such file or directory)
[[1;31mERROR[m]
[[1;31mERROR[m] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[[1;31mERROR[m] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[[1;31mERROR[m]
[[1;31mERROR[m] For more information about the errors and possible solutions, please read the following articles:
[[1;31mERROR[m] [1m[Help 1][m http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
这是 pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<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>com.infotech.book.ticket.app</groupId>
<artifactId>TicketBookingRestApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TicketBookingRestApp</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
我可以知道为什么它说 pom.xml 不可读吗?管道仅在 git repo & clean 阶段成功。
【问题讨论】:
-
看起来工作目录中不存在 TicketBookingServiceJunitTesting 文件夹(在运行构建时创建)。请输入结帐路径或尝试 mvn clean 因为您结帐的根文件夹可能是 github.com/kishancs2020/TicketBookingServiceJunitTesting 。只是预感