alibaba97
alibaba97

Reputation: 21

How to install Mockito into Eclipse using Gradle

I want to use Mockito in my Eclipse, and you can only install it through build programs such as maven or Gradle, I chose to use Gradle. I am a beginner in using Gradle, but I just need to install Mockito and be able to use it as a dependency.

Upvotes: 1

Views: 3771

Answers (1)

Fred Porciúncula
Fred Porciúncula

Reputation: 8902

You don't actually "install" Mockito. You just add it to your dependency management system. Since you're using Gradle, all you have to do is add it to your build.gradle file. I'm assuming you've started with a blank Gradle project or something like that, which included a default build.gradle file.

Somewhere in that file you'll declare all your project dependencies:

dependencies { // other dependencies will be here, just add the following line: testCompile("org.mockito:mockito-core:1.10.19") }

You can find out Mockito's artifact/group ids and available versions here: http://mvnrepository.com/search?q=mockito

Upvotes: 2

Related Questions