gradle / kotlin-dsl-samples

Samples builds using the Gradle Kotlin DSL
https://gradle.org/kotlin/
Other
3.71k stars 434 forks source link

Gradle 5.0 doesn't work (can't find Kotlin deps) #1163

Closed SUPERCILEX closed 6 years ago

SUPERCILEX commented 6 years ago

It looks like Gradle isn't looking on the network:

* What went wrong:
A problem occurred configuring project ':buildSrc'.
> Could not resolve all artifacts for configuration ':buildSrc:classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0-rc-116.
     Searched in the following locations: file:/C:/Users/gojun/.gradle/caches/5.0-milestone-1/embedded-kotlin-repo-1.3.0-rc-116-2/repo/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.0-rc-116/kotlin-gradle-plugin-1.3.0-rc-116.jar
     Required by:
         project :buildSrc > gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.0rc-12
   > Could not find org.jetbrains.kotlin:kotlin-sam-with-receiver:1.3.0-rc-116.
     Searched in the following locations: file:/C:/Users/gojun/.gradle/caches/5.0-milestone-1/embedded-kotlin-repo-1.3.0-rc-116-2/repo/org/jetbrains/kotlin/kotlin-sam-with-receiver/1.3.0-rc-116/kotlin-sam-with-receiver-1.3.0-rc-116.jar
     Required by:
         project :buildSrc > gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.0-rc-12
eskatos commented 6 years ago

@SUPERCILEX, can you share a bit more about this? What is the content of your buildSrc/build.gradle(.kts) would help.

Note that Kotlin 1.3.0-rc-116 requires the kotlin-eap repository to be set up. Also see the breaking changes section of the Kotlin DSL release notes about this: https://github.com/gradle/kotlin-dsl/releases/tag/v1.0-RC12#breaking-changes

SUPERCILEX commented 6 years ago

But it says the EAP repo will be added automatically. Here's my project: https://github.com/SUPERCILEX/Robot-Scouter. Run ./gradlew setup

eskatos commented 6 years ago

Thanks Alex, I can reproduce.

For the kotlin-eap repo to be added automatically add an empty buildSrc/settings.gradle.kts file as instructed in the release notes. Please note that this behaviour will be removed once Kotlin 1.3 GA is available.

SUPERCILEX commented 6 years ago

Ohhhhhhhhh, in buildSrc, I see. Can I just add the EAP maven manually?

eskatos commented 6 years ago

Yes you can

SUPERCILEX commented 6 years ago

Confirmed, it works. The release notes should probably be updated to clarify that buildSrc needs a settings.gradle.kts too for the automatic stuff to work.