How to publish jar to local repository?

sbt
Jeff Axelrod picture Jeff Axelrod · Oct 17, 2011 · Viewed 53.3k times · Source

I have a library compiled to a jar (not an sbt project, no source code, just the jar file) that's not available on a repository.

Is there a way to publish the jar locally so I can add the dependency using the libraryDependencies += "org.xxx" % "xxx" % "1.0" notation? (I already know how to add the file to a project by copying it to the lib folder.)

Answer

Renaud picture Renaud · Aug 24, 2012

The ** publishLocal** action is used to publish your project to a local Ivy repository. By default, this local repository is in ${user.home}/.ivy2/local. You can then use this project from other projects on the same machine source

EDIT: Sorry I misread your question. Here is an example to publish a jar or sources to your local ivy repo.