I can install locally build jar with mvn install:install-file
command. I'm trying to move to sbt
for as many of my projects as possible and therefore looking for a way to achieve this in sbt. Any ideas how this can be done with sbt ?
Asked
Active
Viewed 1,026 times
5

Soumya Simanta
- 11,523
- 24
- 106
- 161
-
Do you mean to install 3rd party jar to your local repository? Or just publish your project built with sbt locally so it can be referenced by other projects? – lpiepiora May 13 '14 at 16:52
-
I mean to install it to my local .m2 repo. I don't see how the two options you mentioned above are different ? I can you give an example or link that explains - "publish your project built with sbt locally" ? thanks. – Soumya Simanta May 13 '14 at 17:21
-
1It is different in a way, that if you have an SBT project, you can run `publishLocal` and it will be published to your local ivy repository (as this is default for SBT). If it's for putting 3rd party jars into ivy cache, it's a bit more complex. Btw. if you want you can still install your 3rd party jars with `mvn install:install-file` and point SBT to your local .m2 repository. – lpiepiora May 13 '14 at 17:36
-
1Thanks. Is publishing to local Ivy repo the only difference between `sbt publishLocal` and `mvn install:install-file`? I know I can use mvn to install in local .m2 and then just use sbt to use it. In fact, that's how I've been using it. But I want build it on a machine that doesn't have mvn and I don't have enough privileges to install mvn on this machine. – Soumya Simanta May 13 '14 at 17:40
-
Well as I've said `publishLocal` is not exactly like `mvn install:install-file`. With the later you can install arbitrary file, while `publishLocal` is used to publish a particular project to the local repository. For you can check http://stackoverflow.com/questions/1200762/good-ivy-tutorial-for-local-repository on how to install arbitrary file (Local repository is in `${user.home}/.ivy2/local`) – lpiepiora May 13 '14 at 17:51