New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency Locking is not resolving all dependencies on testCompileClasspath #21396
Labels
Comments
Any news or progress on this one? |
Noticed when running update locks the following is logged:
(update locks works as expected). In write locks the dependency only appears as runtime:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
./gradlew resolveAndLockAll --write-locks
should resolve all dependencies across all configurations with resolution strategy ofdependencyLocking { lockAllConfigurations()}
and write them to the lockfile.Current Behavior
Certain transitive dependencies are not being resolved on the testCompileClasspath configuration, as a result the lock file is written and at the time of task testCompileJava the lock state validation is failing as the dependency is resolved but it is not included in the lock file.
Context
Java 17 Spring Project
One of my test dependencies 'au.com.dius.pact.provider:junit5spring:4.2.16', has the following transitives:
'org.jetbrains:annotations:13.0'
'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21'
'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
'org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21'
'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21'
My dependency locking is targeting all configurations, after writing locks the above transitives exist in the gradle.lockfile as follows:
When I run a build with tests I get:
I want/ expected the transitives to have been resolved as part of the resolution process on the testCompileClasspath configuration (others have been from what I can see). I would then have expected the gradle.lockfile to include
and as such my builds should pass.
Steps to Reproduce
run
./gradlew resolveAndLockAll --write-locks
Examine gradle.lockfile and observe:
run ./gradlew clean test and see failure
Example Project: https://github.com/shand-j/issue-21396
Build scan URL: https://gradle.com/s/xot6idbw437fm
The text was updated successfully, but these errors were encountered: