当前位置: 首页 > 知识库问答 >
问题:

错误:处理POM时遇到一些问题:

韩峰
2023-03-14

我正在尝试从何处运行此源代码https://github.com/kishancs2020/TicketBookingServiceJunitTestingGithub在我的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 repo唯一成功的渠道

共有1个答案

阎宾实
2023-03-14

maven中的f标志用于指定pom文件,而不是pom文件。当前文件夹中的xml文件,这就是您出现异常的原因。

如果要测试特定的测试类-Dtest开关指定测试类

裁判:https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

 类似资料: