scala - 编写加特林脚本时出现“无法解析符号核心”
问题描述
我正在尝试在 Intellij Idea 上创建一个 Gatling 负载测试脚本,而我正处于起步阶段。我用 Maven 创建了一个 Gatling 项目,但我无法导入 io.gatling.core 包。
你能帮我解决我的问题吗?提前致谢。
我的 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>io.gatling</groupId>
<artifactId>gatling-core</artifactId>
<version>3.5.1</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.5.1</gatling.version>
<gatling-maven-plugin.version>3.1.1</gatling-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-app</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-recorder</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-core</artifactId>
<version>3.5.1</version>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
我想要达到的目标:
import io.gatling.core.scenario.Simulation
import io.gatling.core.Predef._
import io.gatling.http.Predef._
解决方案
或者您应该只使用变量,例如${"ANY_PACKAGE".version}
或从终端检查正确的版本。
推荐阅读
- python-3.x - Jupyterlab 包目录
- android-permissions - Android 权限:“不再询问”存储在哪里?
- javascript - 贝塞尔曲线和旋转
- c# - asp:LinkButton 更新 jquery ui 版本后渲染不同
- c# - 将 VS 项目连接到 SQL Server
- javascript - 试图从角度材料 DatePicker 中获取日、年和月
- haskell - GHC 没有看到 cabal 包
- intellij-idea - Intelli-J 无法启动 - Ubuntu
- javascript - 如何在 +/- 10 处停止循环而不是在 10 处停止?
- javascript - 在 React Redux 中嵌套 API 调用