I am using an external maven project where the generated jar includes a binary file foo/bar/file.dat
whose exact path in the sources is src/main/foo/bar/file.dat
. This file is needed for some reason otherwise the code throws an exception.
I tried to convert it to an SBT project but the file does not get included in the jar.
I tried adding includeFilter in Compile := "parser.dat"
, but this gives me an error:
IO error while decoding .../src/main/foo/bar/file.dat with UTF-8: MALFORMED[1]
Please try specifying another one using the -encoding option
How do I tell SBT to include the file "as-is" in the compiled jar?
EDIT: The linked question is unrelated. The question asks "how to read resources correctly?", while I want to know "assuming that this is the way I have to read resources, how do I create the jar correctly?".
I want to use the 3rd party library as is, without changing the code.