Task Failures with gradle LockMode.STRICT
- Lingua principale
- Java
- Stelle
- 5.6k
- Fork
- 559
- Merge medio
- 1g 14h
- PR unite (30g)
- 43
Descrizione
I enabled gradle dependency locking by following https://docs.gradle.org/current/userguide/dependency_locking.html
When setting the following in the root configuration:
```kotlin
dependencyLocking {
lockAllConfigurations()
lockMode = LockMode.STRICT
}
```
I get failures when running `spotlessCheck` and `spotlessApply`:
```
> Task :spotlessKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':spotlessKotlin'.
> You need to add a repository containing the '[com.pinterest.ktlint:ktlint-cli:1.8.0]' artifact in 'build.gradle'.
E.g.: 'repositories { mavenCentral() }'
```
A workaround is to override the `lockMode` in the `spotless` configuration:
```kotlin
spotless {
configurations.compileClasspath {
dependencyLocking {
lockMode = LockMode.LENIENT
}
}
}
```
But it would be nice if it were possible to lock the ktlint version and allow running with `LockMode.STRICT` all the way :)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the root dependencyLocking configuration and the Spotless configuration shown in the report, then reproduce the failure with spotlessCheck and spotlessApply under LockMode.STRICT. Compare the strict and lenient configurations and verify that the ktlint version can be locked while both Spotless tasks complete successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- kotlin
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100