加特林错误:找不到或加载主类引擎

问题描述 投票:0回答:1

我安装了最新的IntelliJ想法,最新的maven 3.6.3Java 1.8,设置JAVA_HOME / JRE_HOME env变量。然后使用mvn archetype:generate -Dfilter=gatling生成一个加特林项目。总而言之,我遵循了指令here。我也已经为IntelliJ想法安装了Scala插件。当我尝试通过右键单击Engine类来运行Gatling引擎时,我正在错误以下。有人可以告诉我这是怎么回事吗?我在网上尝试了所有建议,但到目前为止还没有运气。谢谢

"C:\Program Files (x86)\Java\jdk1.8.0_221\bin\java.exe".....

Error: Could not find or load main class Engine

Process finished with exit code 1 

这是我的POM文件

<?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.mycompany.gatling</groupId>
  <artifactId>pert-tests</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>

    <gatling.version>3.2.1</gatling.version>
    <gatling-maven-plugin.version>3.0.3</gatling-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.gatling.highcharts</groupId>
      <artifactId>gatling-charts-highcharts</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-app</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>io.gatling</groupId>
      <artifactId>gatling-recorder</artifactId>
      <version>${gatling.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.gatling</groupId>
        <artifactId>gatling-maven-plugin</artifactId>
        <version>${gatling-maven-plugin.version}</version>
      </plugin>
    </plugins>
  </build>
</project>
scala intellij-idea performance-testing gatling scala-gatling
1个回答
0
投票
Test Sources Root并重建项目时,它为我工作。

Mark as Test Sources Root

它应该由IntelliJ自动拾取,但不是这种情况。
© www.soinside.com 2019 - 2024. All rights reserved.