randombee randombee - 1 year ago 149
Scala Question

Add scalacheck dependency to gradle project

I am trying to use scalaCheck (https://github.com/rickynils/scalacheck) to a gradle project. However, adding it this way:

dependencies {
compile group: 'org.scalacheck', name: 'scalacheck_2.11', version: '1.12.5'

doesn't seem to be doing the trick. I also tried to add it in a maven project. In both cases, trying to do the following

import org.scalacheck.Prop.forAll

reports the error

object scalacheck is not a member of package org

I ran "gradle dependencies" before trying to import it, and it seemed to download everything just fine, finishing the command without throwing errors. Is there a way to add scalacheck to my project and if so, how?

Note: not sure if relevant, but I am using Eclipse Neon with all the scala plugins.

Answer Source

(So it seems the problem was with using the eclipse gradle integration.) You have to manually update the project by using the Gradle | Refresh Gradle Project from the project's context menu on each dependency change (though it might be useful to do that on each change to gradle configuration files).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download