when I use intellij ``` Outdated Kotlin Runtime ...
# spring
j
when I use intellij
Copy code
Outdated Kotlin Runtime
			Your version of Kotlin runtime in 'Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.61' library is 1.1.61-release-68 (1.1.61), while plugin version is 1.2.20-release-IJ2017.3-1.
			Runtime library should be updated to avoid compatibility problems.
but this running 🙂
c
add
ext["kotlin.version"] = kotlinVersion
after buildScript
Spring overrides plugin's version
j
@Czar add
Copy code
buildscript {
	ext {
		kotlinVersion = '1.2.20'
		springBootVersion = '2.0.0.M7'
	}
	repositories {
		mavenCentral()
		maven { url "<https://repo.spring.io/snapshot>" }
		maven { url "<https://repo.spring.io/milestone>" }
	}
	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}")
	}
}
ext["kotlin.version"] = '1.2.20'
it still does not work
c
1) this way you have kotlin version defined in two places, why? You already have
kotlinVersion
in ext, you can write
ext["kotlin.version"] = kotlinVersion
to reuse the same one as defined in buildscript 2) How do you mean? This should've gotten rid of 1.1.61 version problem in intellij.
j
ad1 -ok ad2 - intellij is OK ad3. - eclipse not work 😞
Copy code
buildscript {
	ext {
		kotlinVersion = '1.2.10'
		springBootVersion = '2.0.0.M7'
	}
	repositories {
		mavenCentral()
		maven { url "<https://repo.spring.io/snapshot>" }
		maven { url "<https://repo.spring.io/milestone>" }
	}
	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}")
	}
}
ext["kotlin.version"] = kotlinVersion


apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'pl.app'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
compileKotlin {
	kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
	kotlinOptions.jvmTarget = "1.8"
}

repositories {
	mavenCentral()
	maven { url "<https://repo.spring.io/snapshot>" }
	maven { url "<https://repo.spring.io/milestone>" }
}


dependencies {
	compile('org.springframework.boot:spring-boot-starter-data-jpa')
	compile('org.springframework.boot:spring-boot-starter-web')
	compile('org.springframework.boot:spring-boot-starter-webflux')
	compile("org.jetbrains.kotlin:kotlin-stdlib-jre8"){
		exclude(group:"org.jetbrains.kotlin",module:"kotlin-stdlib-jre7")
	}
	compile("org.jetbrains.kotlin:kotlin-reflect")
	runtime('com.h2database:h2')
	testCompile('org.springframework.boot:spring-boot-starter-test')
	testCompile('io.projectreactor:reactor-test')
}
s
Eclipse does not support Kotlin compileer plugin I think