I am trying to create a new Kotlin project that builds using Gradle using IntelliJ IDEA (2016.2.5 on Ubuntu 16.04). When I do this, I immediately get an error message.
Here is what I am trying:
Select "Create New Project" on the welcome screen.
Select "Gradle" from the left pane, "Kotlin (Java)" to the right. Click "Next."
Enter "hello-world" as ArtifactId. Click "Next."
Make sure that "Create a separate module from the source set" and "Use the default shell Gradle" is selected, nothing more. Click "Next."
Use the default values for the name and location of the project. Click Finish.
Then I 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 one is build.gradleas follows:
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 properly create a Kotlin project that builds with Gradle?
source
share