Reputation: 3320
I would like to use code that I wrote for one project in another project, and it seems like the best way to go about doing this is to use packages, but I'm not exactly sure how, and the documentation I found from my googling on this is pretty unclear. Should I sbt package and then copy the .jar into the project I want to use the code for? How does my build.sbt file need to augmented to do this? If the projects are in the same level directory, is there an easier way of doing this?
Upvotes: 2
Views: 573
Reputation: 1270
SBT has a publish-local command that will package and install you jar file in a local repository. Then you can reference you jar as you would any other dependency.
https://github.com/harrah/xsbt/wiki/Publishing
Upvotes: 3