I have a test-suite that contains several files and folders with test data. Some of the files have repeated names in different folders.
In SBT I have a task to generate the resources downloading the resources and uncompressing them in a folder.
The build.sbt file (simplified) is:
import sbt._
import sbt.Keys._
resourceGenerators in Test += Def.task {
val shaclTests = url("https://github.com/w3c/data-shapes/raw/gh-pages/data-shapes-test-suite/tests.zip")
IO.unzipURL(shaclTests, resourceManaged.value / "test-suite" ).toSeq
}.taskValue
when I execute sbt test
I obtain:
[error] (test:copyResources) Duplicate mappings:
[error] C:\src\pruebas\duplicates-sbt\target\scala-2.10\test-classes\manifest.ttl
[error] from
[error] C:\src\pruebas\duplicates-sbt\target\scala-2.10\resource_managed\test-suite\tests\manifest.ttl
...
which complains that the manifest.ttl
file is duplicated.
If I remove the duplicated files it works, however, I think it should be possible to have duplicate file names in different folders.
I have found some related issue here but although I tried to use crossTarget
instead of resourceManaged
it still doesn't work.
I also found this question that may be related, but it is about generating assemblies and the solution doesn't seem to apply.