0

I am trying to setup a new scala project in IntelliJ (2016.3.4, built on January 31, 2017) with gradle. My build.gradle is as given below:

group 'org.microservices.architecture'
version '1.0-SNAPSHOT'

apply plugin: 'scala'

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.scala-lang:scala-library:2.10.1'
}

tasks.withType(ScalaCompile) {
    ScalaCompileOptions.metaClass.daemonServer = true
    ScalaCompileOptions.metaClass.fork = true
    ScalaCompileOptions.metaClass.useAnt = false
    ScalaCompileOptions.metaClass.useCompileDaemon = false
}

dependencies {
    compile group: 'com.typesafe.akka', name: 'akka-actor_2.11', version: '2.4.17'
    compile group: 'org.scala-lang', name: 'scala-library', version: '2.12.1'
    testCompile 'org.scalatest:scalatest_2.11:3.0.1'
    testCompile 'junit:junit:4.12'
}

sourceSets {
    main {
        scala {
            srcDirs = ['src/scala']
        }
    }
    test {
        scala {
            srcDirs = ['test/scala']
        }
    }
}

The problem is I get following warning message:

The following repositories used in your gradle projects were not indexed yet: https://repo1.maven.org/maven2.

If you want to use dependency completion for these repositories artifacts, Open Repositories List, select required repositories and press "Update" button.

Community
  • 1
  • 1
Sergio Rodríguez Calvo
  • 1,183
  • 2
  • 16
  • 32
  • 2
    The warning seems to be self-explanatory. What is the problem? BTW small hint: for your source sets you can use a 1 liner as well like `sourceSets.main.scala.srcDir 'src/scala' ` – LazerBanana Mar 01 '17 at 08:53
  • I think that is not a problem, because IntelliJ can download dependencies, but IDE show that message as warning. And, thanks for your small hint ;) – Sergio Rodríguez Calvo Mar 01 '17 at 09:04
  • 1
    Even if IntelliJ got a nice boost to support Gradle in 2017.3.* it's still not ideal with integration, mine still moan about dependencies cannot be applied to a closure ;) – LazerBanana Mar 01 '17 at 09:11
  • See also [this answer](http://stackoverflow.com/a/42427510/104891) if there is a problem with repository indexing. – CrazyCoder Mar 01 '17 at 14:24

0 Answers0