Your configuration snippet looks good to me. Do you use the java or the java-base plugin? do you probably have multiple sourceSet configuration blocks in your build?
no I don’t have others sourceSets configurations. I have this portion of code
main {
compileClasspath += configurations.provided // include dependencies in provided scope
// runtimeClasspath += configurations.provided // include dependencies in provided scope - it could be required to run tests
}
test {
compileClasspath += configurations.provided // include dependencies in provided scope
// runtimeClasspath += configurations.provided // include dependencies in provided scope - it could be required to run tests
}