Jenkins JMeter 项目中的 Maven 错误, "Error creating properties files for forking"

标签 maven jenkins jmeter jmeter-maven-plugin

我有 Maven JMeter 项目,它使用“mvn verify”从我的主文件夹完美运行,但是当我尝试从 Jenkins 运行它时,我收到控制台的错误消息:

[workspace] $ mvn verify
FATAL: command execution failed
java.io.IOException: Cannot run program "mvn" (in directory "/var/lib/jenkins/jobs/PerformanceTests/workspace"): error=2, No such

file or directory"

如果我尝试从 Jenkins 尝试运行它的文件夹 (/var/lib/jenkins/jobs/PerformanceTests/workspace) 手动运行“mvn verify”,我收到错误消息:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project jmeter: Error creating properties files for forking; nested exception is java.io.IOException: No such file or directory -> [Help 1]

我的 pom 是:

<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>perftest</groupId>
  <artifactId>jmeter</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>jmeter</name>
  <url>http://maven.apache.org</url>
    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>1.8.1</version>
                <configuration>
                    <testResultsTimestamp>false</testResultsTimestamp>
                </configuration>
                <executions>
                    <execution>
                        <id>jmeter-tests</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

同一 Jenkins 基本文件夹“/var/lib/jenkins/jobs”中的所有其他作业都工作正常。我还在 Jenkins 中使用 git 插件。

最佳答案

如果有人仍在为此苦苦挣扎 - 我能够通过将目录的所有者更改为当前用户名而不是 root 来解决它。

关于Jenkins JMeter 项目中的 Maven 错误, "Error creating properties files for forking",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18591411/

相关文章:

java - 是否有增强 Java 访问控制的 Maven 插件?

java - 如何在另一个 Jenkins 声明性管道阶段使用 mvn package 生成的 Jar?

java - Spring Maven 项目中的 Jasmine 测试 :expect jQuery UI autocomplete is not recognized in the spec

java - 无法运行maven

scala - 无法在 Scala 中使用 Apache Commons CLI Option.builder()

java - 没有用于抢先身份验证的凭据 - 端口返回 -1

jenkins - jenkins dsl 中的 booleanParam

rest - Jmeter : How to check for empty text response

ant - Jmeter远程执行——有没有办法从ant提供全局属性?

java - post请求中禁止响应-jMeter