0

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 {


}

1 Answers1

1

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

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • Thank you for the solution. This fixed my issues but has lead me to wondering, do you recommend i use wiremocks in the program or inside the tests? – Brendan Ahern Apr 03 '23 at 11:57