If it is supported by the project you have cloned (that is, if it supports SBT and is configured to publish to a repository), you can publish it locally with the sbt command sbt publish-local
. For example:
cd ~/code/scala/otherlib
sbt publish-local
This will build and publish this library in your local Ivy repository (typically ~/.ivy2/local
). Note that you will need to repeat this each time you modify the otherlib
sources.
After the project's published locally to the local Ivy repository, you can specify otherlib
as a dependency in your SBT project, using the regular SBT dependency for the original version of the forked library (assuming that you haven't changed its ID, version, group ID, etc.). For example, by adding:
libraryDependencies += "com.some_company" % "otherlib" % "1.0.0"
to your build.sbt
file.
Now, when you build your project, it will find otherlib
in your local Ivy repository (as if it'd been pulled down from a regular repository) and will use your custom version of it.
If otherlib
doesn't support SBT, or isn't configured to publish to a repository, and you do not want to modify it to do so, then you can simply copy its .jar file(s) to the /lib
directory (~/code/scala/myProgram/lib
) of your project.