I'm trying to create a relatively simple sbt plugin to wrap grpc-swagger artifact. Therefore, I've created a project with the following structure:
projectDir/
build.sbt
lib/grpc-swagger.jar <- the artifact I've downloaded
src/...
where build.sbt
looks like the following:
ThisBuild / version := "0.0.1-SNAPSHOT"
ThisBuild / organization := "org.testPlugin"
ThisBuild / organizationName := "testPlugin"
lazy val root = (project in file("."))
.enable(SbtPlugin)
.settings(name := "grpc-swagger-test-plugin")
According to sbt docs, that's all I have to do in order to include an unmanaged dependecy, that is:
- create a
lib
folder; - store the artifact in there;
However, when I do execute sbt compile publishLocal
, the plugin published lacks of that external artifact.
So far I've tried to:
- set
exportJars := true
flag - add
Compile / unmanagedJars += file(lib/grpc-swagger.jar")
(with also variations of the path) - manual fiddling to
libraryDependecies
usingfrom file("lib/grpc-swagger.jar")
specifier
but none so far seemed to work.
So how am I supposed to add an external artifact to a sbt plugin?