Reputation: 9263
An easy way to get rid of *everything* generated by SBT? asks for an easy way to clean up all files generated from sbt, and didn't find one. I'll ask for a hard one. How do I get a make cleanall
with sbt?
UPDATE: For a definition of everything, you have to know why you ever need to clean all
. There are two common reasons:
To distribute something: You need to confirm that someone can take a fresh machine, download your code, and build it without problem. (Or, someone can't, and you want to debug).
When something has gone horribly wrong. Some funny version of some jar somewhere is breaking something somehow. Sometimes it's easiest to just start fresh, rather than try to debug... (See Jim Gray's Why Computers Stop)
Upvotes: 3
Views: 661
Reputation: 5624
Here are the usual suspects of things you need to clean:
~/.sbt/boot
- Safe cache of sbt itself to avoid disappearing JAR oddiites~/.sbt/**/target
- Compiled global plugin/build definitions.~/.ivy2/cache
- Ivy cache of resolved dependencies~/.ivy2/local
- publishLocal
files<cwd>/project/**/target
- Compiled build/plugin definitioins<cwd>/**/target
- Artifacts from building your project, including compiler caches, classfiles, etc.sbt is unable to provide a "clean everything" task directly, because deleting the JARs/classes sbt is actively using to run your build leads to super odd and evil behavior. But you could write a simple BASH script which can accomplish this if desired.
Upvotes: 1