Sep 7, 2018

How to solve: Exception in thread "main" java.lang.NoClassDefFoundError: io/restassured/RestAssured ?

Exception in thread "main" java.lang.NoClassDefFoundError: io/restassured/RestAssured

Just Change Scope : Test --> Compile for rest-assured artifact in POM.xml

Before:
    <!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
        <dependency>
            <groupId>io.rest-assured</groupId>


            <artifactId>rest-assured</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>

After:
    <!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>3.1.0</version>
            <scope>compile</scope>
        </dependency>