-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting assemblyOutputPath to "." leads to data loss! #216
Comments
Just ran into the same problem. Should be easy enough to fix with a PR (will try to do that). |
This is the cause of the problem: def makeJar(sources: Seq[(File, String)], jar: File, manifest: Manifest, log: Logger): Unit = {
log.info("Packaging " + jar.getAbsolutePath + " ...")
IO.delete(jar)
log.debug(sourcesDebugString(sources))
IO.jar(sources, jar, manifest)
log.info("Done packaging.")
} It unconditionally recursively deletes |
Would a maintainer mind closing this? (Poke @eed3si9n) This is fixed in an upcoming SBT release, by virtue of sbt/sbt#3014. |
Just hit this as well, with sbt-assembly Is the recommended fix to upgrade SBT to |
@ryan-williams It is sufficient to update sbt, yes. No upgrade of the plugin required. |
Actually per #523, we can still manage to lose data via |
Please add a warning to the documentation about the possible data loss when setting
assemblyOutputPath
folder. I didn't expect that the content is emptied during the build.Judging by the name of the property, I was expecting that assembly plugin will just save the output (the überjar) in the specified folder. I did not expect anything to be deleted. At most -- just an overwrite of the old file it generated during the last build.
If the assembly plugin uses this folder as some sort of work dir as well, please name the property accordingly.
How to reproduce (if you really must):
I needed to save shadowed jar file in the root of my project so I tried setting up
I ran the build just once and then the
src/
and.git/
folders and everything else in the project got deleted.The text was updated successfully, but these errors were encountered: