1

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.

Community
  • 1
  • 1
Labra
  • 1,412
  • 1
  • 13
  • 33
  • The files are indeed copied to target even though the task fails. I get the feeling this is some sort of SBT bug. – marios Jun 03 '15 at 04:09
  • 1
    Yes, the files are copied but the target stops and doesn't let me continue with the tests. I have filed [this issue](https://github.com/sbt/sbt/issues/2047) – Labra Jun 10 '15 at 19:27
  • I did try to find a way to continue even though a task fails, but I wasn't able to get that working ... I think it's a good idea to raise the bug. I am sure it's a problem from their side. – marios Jun 10 '15 at 20:39

0 Answers0