I am new to using IntelliJ. I setup the project structure to level 8 and added the SDK and required fields. Now in the POM I have the maven dependency for RESTAssured 3.0.3 I can see the dependency jar but it is not working in the project. The import itself is failing. Please help.
Rest assured 3.0.3 maven dependency in IntelliJ IDEA not working
3.7k views Asked by AudioBubble At
7
There are 7 answers
0
On
Worked for me. In the dependency, I had the scope tag with the value "test". Add the same dependency and add the scope as "compile."
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.4.0</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.3.0</version>
<scope>compile</scope>
</dependency>
0
On
First of all clear all the dependancy present in .m2>repository> io folder. io folder store rest assured all dependancy. Enable auto import, if still not able to import then right click on project>maven> reimport . Add following code in pom.xml for dependancy download. This will resolve your problem.
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.rest-assured/json-path -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>3.0.3</version>
</dependency>
<!-- to validate that a JSON response conforms to a Json Schema -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.rest-assured/xml-path -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>xml-path</artifactId>
<version>3.0.3</version>
</dependency>
You should rebuild or clean and restart your project. Make sure it will work.