How can I add a dependency to my sbt plugin?

两盒软妹~` 提交于 2019-12-24 12:51:26

问题


I would like to add a library that I am going to use within the code of my SBT-Plugin.

I did

...

sbtPlugin := true

libraryDependencies += "..." %% "..." % "..."

enablePlugins(SbtPlugin)

scriptedLaunchOpts := {
  scriptedLaunchOpts.value ++
    Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
}

scriptedBufferLog := false

...

in build.sbt located in the root of my plugin project.

▶ tree -L 1
.
├── README.md
├── build.sbt <- this one
├── project
└── src

But when I run the test, following: https://www.scala-sbt.org/1.x/docs/Testing-sbt-plugins.html .

I run

sbt 'set isSnapshot := true' scripted

And I am getting

java.lang.NoClassDefFoundError

with some class coming from the library I added.


Am I doing something wrong ?

来源:https://stackoverflow.com/questions/55895632/how-can-i-add-a-dependency-to-my-sbt-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!