ktlintApplyToIdea fails on Cannot resolve external dependency
See original GitHub issueHi,
I am having issue with tasks ktlintApplyToIdea and ktlintApplyToIdeaGlobally in my project. Other tasks are running correctly and returns proper result but ktlintApplyToIdea returns:
Execution failed for task ':ktlintApplyToIdea'.
> Could not resolve all files for configuration ':ktlint'.
> Cannot resolve external dependency com.github.shyiko:ktlint:0.29.0 because no repositories are defined.
Required by:
project :
My configuration of build.gradle.kts in root project:
buildscript {
val kotlinVersion = "1.3.10"
repositories {
mavenCentral()
gradlePluginPortal()
}
....
}
plugins {
val ktlintPluginVersion = "6.3.1"
id("com.gradle.build-scan") version "2.0.2"
id("org.jlleitschuh.gradle.ktlint") version ktlintPluginVersion
}
subprojects {
apply(plugin = "kotlin")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
....
tasks {
configure<KtlintExtension> {
debug.set(true)
verbose.set(true)
android.set(false)
outputToConsole.set(true)
reporters.addAll(ReporterType.PLAIN, ReporterType.CHECKSTYLE)
ignoreFailures.set(true)
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}
}
}
I am using Gradle 4.10.2 and Gradle 5 with both having same result. I tried adding ktlint dependency from error to buildscript.dependencies under classpath but I was unsucessful.
Do you know what is wrong? Thank you for answer.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cannot resolve external dependency for gradle - Stack Overflow
The build fails and returns: Cannot resolve external dependency com.android.tools.build:gradle because no repositories are defined.
Read more >MVNFE “Cannot resolve external dependency org.jetbrains ...
ModuleVersionNotFoundException : Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.41 because no repositories are defined.
Read more >Cannot resolve external dependency com.android.tools.build ...
I do an update in my android studio, i have the following error. I know that the problem in build.gradle, how can i...
Read more >Gradleのメモ
gradlew spotlessCheck Starting a Gradle Daemon (subsequent builds will be faster) FAILURE: Build failed with an exception. * What went wrong: Execution ...
Read more >Getting errors when trying to run runClient - ForgeGradle
Error #1. Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Cannot resolve external dependency ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JLLeitschuh Your answer is wrong and this is a bug.
Gradle plugins should be isolated from compiling the code and their classpath is defined in
buildscript{}
block. Currently your plugin is polluting the code classpath.Jakub’s project did not have any sources in the root project and there is no sense in defining any repositories for the root project.
My bad… I added repositories to:
and it works great now. Thank you for help & and this project.