spring-bootmavendependencieswiremockmockserver

Wiremock dependency not importing classes


I am trying to use Wiremock for my spring api. I am using Java 17.

I am using this dependency

<dependency>
    <groupId>com.github.tomakehurst</groupId>
    <artifactId>wiremock-standalone</artifactId>
    <version>2.27.2</version>
    <scope>test</scope>
</dependency>

I am trying to import the WireMockServer class

I have tried saving the pom.xml, cleaning and startig the project, updating the project, but it still wont import the class i want or anything else from the import, just keeps telling me i need to make the class

the code in my MockServerConfig.java class is

public class MockServerConfig extends WireMockServer {


}

Solution

  • A dependency with <scope>test</scope> can only be used in tests. Remove the scope to use it elsewhere.