I'm trying to create a new Kotlin project that builds with Gradle using IntelliJ IDEA (2016.2.5 on Ubuntu 16.04). When I do this I immediately get an error message.
Here's what I'm trying:
Select "Create New Project" from Welcome Screen.
Select "Gradle" from left hand pane, "Kotlin (Java)" from right. Click "Next".
Enter "hello-world" as ArtifactId. Click Next.
Ensure "Create separate module from source set" and "Use default Gradle wrapper" are selected, nothing else is. Click "Next".
Use defaults for project name and location. Click "Finish".
I then immediately get this error:
Gradle 'hello-world' project refresh failed
Error: Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.1-M02-12.
Searched in the following locations:
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1-M02-12/kotlin-gradle-plugin-1.1-M02-12.pom
https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1-M02-12/kotlin-gradle-plugin-1.1-M02-12.jar
Required by:
:hello-world:unspecified
The generated build.gradle
looks like this:
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1-M02-12'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
How can I create a Kotlin project that builds with Gradle correctly?