How to add a jar file located in root folder to li

2019-08-25 02:59发布

I have a case where I need to a jar file located in root folder of the project.

enter image description here I have tried the below :

"ccp.mts.test" % "mts-test_2.12-0.2" % "2.0" from "/mts-test_2.12-0.2.jar"

It did not work. Then I tried like below :

unmanagedJars in Compile += file("lib/mts-test_2.12-0.2.jar")

This also didn't work.

How can I do it?

1条回答
beautiful°
2楼-- · 2019-08-25 03:29

You did not specify the file protocol. Try the following

libraryDependencies += "org.aspectj" % "aspectjrt" % "1.9.2" from ("file://./aspectjrt-1.9.2.jar")

EDIT

I am modifying my answer based on your comment.

In order to provide the absolute path, you can use the following code snippet

val currentDirectory = new java.io.File(".").getCanonicalPath
libraryDependencies += "org.aspectj" % "aspectjrt" % "1.9.2" from ("file://" + currentDirectory + "/aspectjrt-1.9.2.jar")
查看更多
登录 后发表回答