Czar
06/13/2017, 9:09 AMStarting with Kotlin 1.1.2, the dependencies with groupSo, when I updated fromare by default resolved with the version taken from the applied plugin.org.jetbrains.kotlin
1.1.1
to 1.1.2-5
I removed $kotlinVersion
from my compile dependencies: compile 'org.jetbrains.kotlin:kotlin-stdlib-jre8'
Unfortunately though for `./gradlew build`:
Execution failed for task ':*****:*****:compileKotlin'.
> Could not resolve all dependencies for configuration ':*****:*****:detachedConfiguration5'.
> Could not find org.jetbrains.kotlinkotlin stdlib jre8.
Searched in the following locations:
file:/home/czar/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom
file:/home/czar/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar
https://artifactory.********/repository/maven-releases/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom
https://artifactory.********/repository/maven-releases/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar
Required by:
project :*****:*****And when I try to refresh the project in IntelliJ, I get very similar error:
>>Error: Could not find org.jetbrains.kotlinkotlin stdlib jre8. Searched in the following locations: file:/home/czar/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom file:/home/czar/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar https://artifactory.*******/repository/maven-releases/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.pom https://artifactory.*******/repository/maven-releases/org/jetbrains/kotlin/kotlin-stdlib-jre8//kotlin-stdlib-jre8-.jar Required by: project ******* > project ******
yole
06/13/2017, 9:33 AMh0tk3y
06/13/2017, 12:58 PM:*****:*****:compileKotlin
) seems like you have subprojects with Kotlin. Do you have the same version of Kotlin Gradle plugin applied to all the subprojects? Please make sure it's 1.1.2+.Czar
06/13/2017, 12:59 PMCzar
06/13/2017, 1:17 PMroot project
│
├ sub-project1
│ │
│ ├ sub-sub-project1
│ ╰ sub-sub-project2
│
â•° sub-project2
In root project
I have following buildscript block:
buildscript {
ext { kotlinVersion = '1.1.2-5' }
repositories {
mavenLocal()
jcenter()
maven {
url "<https://plugins.gradle.org/m2/>"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
neither root project
nor `sub-project`s contain any code themselves instead they serve to compartmentalize application modules
all `sub-project`s whose sub-sub-projects need Kotlin I have following:
configure(subprojects) {
group = "******"
apply plugin: 'kotlin'
// groovy code should have access to kotlin classes
tasks.compileGroovy.dependsOn 'copyMainKotlinClasses'
// and also for tests
tasks.compileTestGroovy.dependsOn 'copyTestKotlinClasses'
tasks.findAll { it.name in ['compileKotlin', 'compileTestKotlin'] }.each {
it.kotlinOptions.jvmTarget = "1.8"
}
}
And finally in all sub-sub-projects that use Kotlin I have K specific dependencies:
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlinVersion"
So there is no way for having different versions of kotlin for sub- or sub-sub- projects.Czar
06/13/2017, 2:04 PMh0tk3y
06/13/2017, 6:25 PMCzar
06/14/2017, 9:43 AM