Task Failures with gradle LockMode.STRICT
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- kotlin
- Domain
- build-system
Research direction
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.
Written by the indexing model from the issue text.
Description
I enabled gradle dependency locking by following https://docs.gradle.org/current/userguide/dependency_locking.html
When setting the following in the root configuration:
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:
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 :)
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100