Problem with Kotlin Plugin


(Peter Melson) #1

I am new to Gradle and, to do date, have used simple build scripts for Kotlin applications developed using Intellij IDEA.

Recently, builds have been failing with the message:

22:46:05.867 [ERROR] [org.gradle.BuildExceptionReporter]
22:46:05.868 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:46:05.868 [ERROR] [org.gradle.BuildExceptionReporter]
22:46:05.869 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
22:46:05.869 [ERROR] [org.gradle.BuildExceptionReporter] Build file ‘/Users/Pete/IdeaProjects/ptm-annualleave/build.gradle’ line: 16
22:46:05.869 [ERROR] [org.gradle.BuildExceptionReporter]
22:46:05.869 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:46:05.870 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred evaluating root project ‘ptm-annualleave’.
22:46:05.870 [ERROR] [org.gradle.BuildExceptionReporter] > Failed to apply plugin [id ‘kotlin’]
22:46:05.870 [ERROR] [org.gradle.BuildExceptionReporter] > For input string: ""
22:46:05.870 [ERROR] [org.gradle.BuildExceptionReporter]

The associated build script is:

buildscript {
ext {
kotlinVersion = '1.0.6’
springBootVersion = ‘1.5.1.RELEASE’
}
repositories {
mavenCentral()
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
classpath(“org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}”)
classpath(“org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}”)
}
}

apply plugin: 'kotlin’
apply plugin: 'kotlin-spring’
apply plugin: 'eclipse’
apply plugin: ‘org.springframework.boot’

jar {
baseName = 'ptm-annualleave’
version = ‘0.0.1-SNAPSHOT’
}

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
compile(‘org.springframework.boot:spring-boot-starter-data-jpa’)
compile(‘org.springframework.boot:spring-boot-starter-data-rest’)
compile(‘org.springframework.boot:spring-boot-starter-web’)
compile(“org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}”)
compile(“org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}”)
runtime(‘mysql:mysql-connector-java’)
testCompile(‘org.springframework.boot:spring-boot-starter-test’)
}

I am unclear what the underlying cause of this error is or how to correct it.

Any suggestions gratefully received.