请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Jenkins持续集成报错

Running as SYSTEM
Building in workspace /Users/Shared/Jenkins/Home/workspace/Test
Parsing POMs
ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /Users/thm/Documents/workspace/test/pom.xml: /Users/thm/Documents/workspace/test/pom.xml (Operation not permitted) @

at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:383)
at hudson.maven.MavenEmbedder.buildProjects(MavenEmbedder.java:370)
at hudson.maven.MavenEmbedder.readProjects(MavenEmbedder.java:340)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1329)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1126)
at hudson.FilePath.act(FilePath.java:1075)
at hudson.FilePath.act(FilePath.java:1058)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:987)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:691)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1853)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)

Finished: FAILURE

把maven的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>APP</groupId>
    <artifactId>APPTEST</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>APPTEST</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <xmlFilename>testng.xml</xmlFilename>
    </properties>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>6.1.0</version>
        </dependency>
        <!--https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java-->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.12.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.uncommons/reportng -->
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.17</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <!--需要和poi版本保持一致-->
            <version>3.17</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
        <dependency>
            <groupId>com.aventstack</groupId>
            <artifactId>extentreports</artifactId>
            <version>3.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.1.1</version>
            <scope>compile</scope>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.17</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <forkMode>once</forkMode>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <!--配置reportNG 开始-->
                    <properties>
                        <!--关闭默认的监听 -->
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <!--将默认的监听替换成自定义的监听 -->
                        <property>
                            <name>listener</name>
                            <value>org.uncommons.reportng.HTMLReporter</value>
                        </property>
                    </properties>
                    <!--配置reportNG 结束-->
                    <workingDirectory>target/</workingDirectory>
                </configuration>
            </plugin>
            <!--配置javamail-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <includePluginDependencies>true</includePluginDependencies>
                            <mainClass>mail.AutoMail</mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

正在回答 回答被采纳积分+3

1回答

风落几番 2020-02-13 01:34:40

看报错信息,仔细分析。no readable pom 就是文件格式压根不正确,你在本地先把起来才能上Jenkins 不能不管不顾跳着来,跟着课程一点一点做

1 回复 有任何疑惑可以回复我~
  • 提问者 心酸果冻 #1
    这个问题我查过资料,我用的是MAC,本地流程跑testng.xml和pom.xml都是没有问题的。不知道为什么jenkins启动不起来,报这个错误。文件也设置了可读可写的权限,想问问老师遇到过这样的问题没?
    
    我之前用的是eclipse自带的maven,后面换成了idea,感觉跟这个有点关系
    回复 有任何疑惑可以回复我~ 2020-02-13 10:00:05
  • 风落几番 回复 提问者 心酸果冻 #2
    跟ide应该没关系,不过mac我确实没用过,按报错来说应该就是jenkins解析pom失败掉了,具体的原因看不出来从日志里,你可以先写个最简单的hello world的测试类,pom里啥包没有就启动个testng试试
    回复 有任何疑惑可以回复我~ 2020-02-13 10:08:44
  • 提问者 心酸果冻 #3
    jenkins是从官网上下载的pkg安装包,经过查资料有问题,现通过brew安装再试试
    回复 有任何疑惑可以回复我~ 2020-02-13 10:52:41
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信