Fixing Gradle error: Cannot infer Scala class path because no repository is declared for the project.

When you get this error:

Cannot infer Scala class path because no repository is declared for the project.

This means the maven repository is not set up – if you add the following it will work. This allows gradle to resolve dependencies on it’s own.

repositories {
    mavenCentral()
}

One Reply to “Fixing Gradle error: Cannot infer Scala class path because no repository is declared for the project.”

  1. Weird that my build script already has that declared, also with a couple of repos and the build still fails:

    repositories {
    mavenLocal()
    mavenCentral()
    maven{
    url ‘http://conjars.org/repo/’
    artifactUrls ‘http://clojars.org/repo/‎’
    artifactUrls ‘http://maven.twttr.com/’
    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *