The import io.restassured.RestAssured cannot be resolved

While consuming restassured maven dependencies it has been observed that even after downloading the dependencies eclipse is not able to resolve io.restassured package.

Maven repository ( has the scope set to test in the dependency tag. This limits your code from accessing that dependency’s classes within your source code. That is, you can access those classes only within your test sources (ex: ${project.dir}/src/test/java/, ${project.dir}/test/.

Mostly that is not the intended use case, so just remove the scope attribute.

<!-- -->
    <!-- <scope>test</scope> -->

3 thoughts on “The import io.restassured.RestAssured cannot be resolved

  1. Dirk says:

    I get a message “cannot access io.restassured.common.mapper.TypeRef” even though I only use it in my test classes.
    Currently using version 4.4.0

    1. Dirk says:

      You may not load both dependencies with artifactId rest-assured and spring-web-test-client.

  2. kumar says:

    <!– test –>, it works.

Leave a Reply

Your email address will not be published. Required fields are marked *