import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig - 无法解析符号'核心'

时间:2017-09-25 10:51:30

标签: java intellij-idea wiremock

继续在IntelliJ上出现此错误

Cannot resolve symbol 'core'用于以下导入

import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig

不完全确定原因。以下代码也显示错误。

代码:

wireMockServer = new WireMockServer(wireMockConfig().port(port));

错误:

Cannot resolve method 'wireMockConfig()'

愚蠢检查任何人?感谢。

1 个答案:

答案 0 :(得分:2)

WireMock分为两种版本 - 一个只包含WireMock的标准JAR,一个包含WireMock及其所有依赖项的独立fat JAR

<dependency>
    <groupId>com.github.tomakehurst</groupId>
    <artifactId>wiremock</artifactId>
    <version>2.9.0</version>
</dependency>

http://wiremock.org/docs/getting-started/