question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Same file can't be packaged multiple times

See original GitHub issue

On sbt 0.13.8 (haven’t tested other versions), if I do:

mappings ++= Seq(
  foo -> "foo1",
  foo -> "foo2"
)

Only foo2 ends up in the packaged jar. Both should be packaged.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jropercommented, Aug 13, 2018

This bug still exists in sbt 1.2.0:

mappings in (Compile, packageBin) := {
  val readme = baseDirectory.value / "README.txt"
  Seq(
    readme -> "README1.txt",
    readme -> "README2.txt"
  )
}
lazy val extract = taskKey[Unit]("extract jar file")
extract := {
  IO.unzip((packageBin in Compile).value, target.value / "extracted")
}
$ sbt extract
[info] Loading project definition from /home/jroper/tmp/package-bug/project
[info] Loading settings for project package-bug from build.sbt ...
[info] Set current project to package-bug (in build file:/home/jroper/tmp/package-bug/)
[success] Total time: 0 s, completed 13/08/2018 11:59:14 AM
$ ls target/extracted/
META-INF  README2.txt
0reactions
muuki88commented, Aug 13, 2018

Thanks for the fast reply and detailed research. I’ll try to tackle this issue 😎

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installer project packaging files multiple times - Stack Overflow
And this number doubles each time a build is run. I tested this with the following line: Packaging file 'System. IO.
Read more >
Fixing “Target Packages is configured multiple times” Error in ...
The fix is to read the error message (it's a warning, actually) correctly and edit the file to remove (or comment out) duplicate...
Read more >
dotnet pack might include the same file multiple times ... - GitHub
dotnet pack could include the same file multiple times, producing invalid packages. Detailed repro steps so we can see the same problem. Create ......
Read more >
Solved: Illustrator 22.0.1 Creates Multiple Linked File So...
But yes, I am use to it using the file only once while packaging, if it is the same file, and instead of...
Read more >
debian - How to install two packages that write the same file
Packages providing same file(s) should conflict with each other -- it they don't it is a bug ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found