我试着从哪里得到这个源代码https://github.com/kishancs2020/ticketbookingservicejunittesting github在我的jenkins中看到了在jenkins中创建的管道文件的源代码。
我已经更新了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回购和清理阶段成功。
1条答案
按热度按时间piwo6bdm1#
-f
maven中的标志用于指定pom文件,而不是pom.xml
当前文件夹中的文件,这就是您获得异常的原因。如果要测试特定的测试类
-Dtest
切换以指定测试类裁判:https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html