pedro
07/04/2020, 3:19 PMExecution failed for task ':foo:detekt'.
> Could not resolve all files for configuration ':foo:detekt'.
> Could not find io.gitlab.arturbosch.detekt:detekt-cli:1.10.0.
Searched in the following locations:
- <https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-cli/1.10.0/detekt-cli-1.10.0.pom>
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
I have seen someone mentioning in github issues that it seems that some artifacts weren’t published in all repositories
If I try to use 1.9.1:
> Could not find org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.1.
Searched in the following locations:
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-html-jvm/0.7.1/kotlinx-html-jvm-0.7.1.pom>
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :foo > io.gitlab.arturbosch.detekt:detekt-cli:1.9.1
I’ve tried all possible combinations of the instructions in the website and still haven’t got it to work. Can someone help?buildscript {
dependencies {
// classpath "org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.1"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.9.1"
}
It doesn’t help that the detekt recommends slightly different approaches in different places and some of them actually have syntax errors (happy to post some of those issues on a separate thread)gammax
07/04/2020, 4:28 PMrepositories{}
block and this is causing the build to fail.It doesn’t help that the detekt recommends slightly different approaches in different places and some of them actually have syntax errors (happy to post some of those issues on a separate thread)If you could actually create a Github Issue or open a PR, that would be great 👌
pedro
07/04/2020, 4:34 PMBrais Gabin
07/04/2020, 6:18 PMpedro
07/04/2020, 8:18 PMonly buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed
.
Wrapping it with buildscript { ... }
it goes back to the error message I posted, where it can’t find kotlinx html
fwiw, this is the gradle file now:
buildscript {
repositories {
jcenter()
// or
// also tried removing the repositories below this line
mavenCentral()
jcenter {
content {
// just allow to include kotlinx projects
// detekt needs 'kotlinx-html' for the html report
includeGroup "org.jetbrains.kotlinx"
}
}
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.9.1"
}
It shouldn’t affect this, but this is in a multi module project. Although to simplify things I am trying to apply this directly in one of the modules…
This is an open source project so you can get exactly the same code as me if you want to try it on your computerbuildscript {
repositories {
maven { url "<https://plugins.gradle.org/m2/>" }
jcenter()
}
dependencies {
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.9.1"
}
Same kotlinx html errorgammax
07/04/2020, 8:23 PMThis is an open source project so you can get exactly the same code as me if you want to try it on your computerCan you please link it?
pedro
07/04/2020, 8:34 PMmvflow-core/build.gradle
file instead of the one in the root folder.feature/code_quality_improvements
but it shouldn’t affect this either.gammax
07/04/2020, 8:42 PMplugins {
id "io.gitlab.arturbosch.detekt" version "1.10.0"
}
repositories {
mavenCentral()
jcenter()
}
buildscript{}
syntax, also this will work:
buildscript {
repositories {
maven { url "<https://plugins.gradle.org/m2/>" }
}
dependencies {
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.10.0"
}
}
apply plugin: 'io.gitlab.arturbosch.detekt'
repositories {
jcenter()
}
pedro
07/04/2020, 8:50 PM