One way we can do is by adding jar explicitly in the Intellij but the problem with this approach is every time we build the project we need to add it again.
First way to do is :
In Intellij Idea:
File > Project Structure > Libraries
Another way is to publish the jar in local
Step 1 : Place the jar in any accessible folder.
Step 2 Create a build.sbt file which contains the detail of the jar.
Step 3 Open cmd to that path and execute command sbt publishLocal.
Step 4 Build your code and you would observe that you are able to access the classes belong to that jar.
build.sbt would look something like this:
organization := "com.abc.core"
name := "abc-test-logging"
version := "1.0-SNAPSHOT"
crossPaths := false
packageBin in Compile := file(s"${name.value}-${version.value}.jar")