jenkins配置java+maven+testng.xml执行报错,本地执行成功

问题遇到的现象和发生背景

Mac+IDEA+maven+java+testng.xml
本地执行maven test testng.xml成功

img

img

mac搭建Jenkins并配置好环境后,Jenkins 构建maven项目报错

img

img

问题相关代码,请勿粘贴截图
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <forkMode>once</forkMode>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <systemProperties>
                        <property>
                            <name>net.sourceforge.cobertura.datafile</name>
                            <value>target/cobertura/cobertura.ser</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <executable>/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin/javac</executable>
                </configuration>
            </plugin>
        </plugins>
    </build>
我的解答思路和尝试过的方法

看着是maven jar包的问题,但是检查了一下Jenkins系统设置和项目都做了maven相关的配置

img

img

img


jar有问题,你的setting配置 文件指定的 所有jar目录下面有没有这个jar

你用jdgui 工具反编译一下这个jar包看看有没有

img


这个类