Setting sourceSets resource config srcDir property in build script causes build failure due to duplicateStrategy in Windows #27103
Labels
closed:duplicate
Duplicated or superseeded by another issue
Current Behavior
In windows 11, with gradle 7.6.1
sourceSets { main { resources { srcDir 'src/main/resources' } } }
When the above property is set and there are any files present in the srcDir location, then build failure occurs with the following message
FAILURE: Build failed with an exception.
Execution failed for task ':app:processResources'.
The build failure could be resolved with commenting out srcDir (since this is a default value) or setting duplicateStrategy to any of the available values.
Expected Behavior
The build script should have been executed without any issue. without the need to set duplicateStrategy or commenting out the srcDir
Context (optional)
https://discuss.gradle.org/t/using-sourcesets-along-with-jar-task-in-gradle-build-causing-build-failure-in-windows-due-to-duplicatestrategy-not-being-set/47034
The discussion related to this bug has occurred in the gradle forum which might give additional context.
Steps to Reproduce
mentioned in this repo
https://github.com/psvkushal/gradle-sourceSets-buildFailure-Windows
Gradle version
7.6.1
Build scan URL (optional)
No response
Your Environment (optional)
Windows 11, the issue is not occurring in macOS
The text was updated successfully, but these errors were encountered: