javaspringspring-datarest-assured

The import org.springframework.data cannot be resolved in gradle


I refreshed my gradle project but it gives me error that " The import org.springframework.data cannot be resolved "

The following are some imports which it doesn't understands

import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.ScriptOperations;
import org.springframework.data.mongodb.core.query.BasicQuery;
import org.springframework.data.mongodb.core.script.ExecutableMongoScript;
import static org.springframework.data.mongodb.core.query.Criteria.where;
import static org.springframework.data.mongodb.core.query.Query.query;

There are more imports which it is unable to resolve.

Please give me any suggestion to resolve this issue.

Thanks in advance.


Solution

  • Added a dependency into build.gradle file as :

    org.springframework.data:spring-data-mongodb:1.7.2.RELEASE

    This solved my problem.