安装onejar插件时找不到sbt值addSbtPlugin
我正在尝试 安装 one-jar sbt 插件 但出现以下错误:
sbt/project/plugins/plugins.sbt:5: error: not found: value addSbtPlugin
addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6")
这是我的 sbt/build.sbt
文件的相关内容:
seq(com.github.retronym.SbtOneJar.oneJarSettings: _*)
name := "dsg_nlp"
version := "0.11"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "1.6.1" % "test" )
libraryDependencies += "commons-lang" % "commons-lang" % "2.6"
traceLevel in run := 0
fork in run := true
javaOptions in run ++= Seq("-Xmx7G", "-agentlib:hprof=cpu=samples,depth=12", "-server", "-enableassertions")
scalacOptions ++= Seq("-optimize")
mainClass in (one-jar, Compile, packageBin) := Some("Test")
以及我的 project/plugins/plugins.sbt
文件的内容:
resolvers += "retronym-releases" at "http://retronym.github.com/repo/releases"
resolvers += "retronym-snapshots" at "http://retronym.github.com/repo/snapshots"
addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6")
I'm trying to install the one-jar sbt plugin but am getting the following error:
sbt/project/plugins/plugins.sbt:5: error: not found: value addSbtPlugin
addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6")
Here is the relevant contents of my sbt/build.sbt
file:
seq(com.github.retronym.SbtOneJar.oneJarSettings: _*)
name := "dsg_nlp"
version := "0.11"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "1.6.1" % "test" )
libraryDependencies += "commons-lang" % "commons-lang" % "2.6"
traceLevel in run := 0
fork in run := true
javaOptions in run ++= Seq("-Xmx7G", "-agentlib:hprof=cpu=samples,depth=12", "-server", "-enableassertions")
scalacOptions ++= Seq("-optimize")
mainClass in (one-jar, Compile, packageBin) := Some("Test")
And the contents of my project/plugins/plugins.sbt
file:
resolvers += "retronym-releases" at "http://retronym.github.com/repo/releases"
resolvers += "retronym-snapshots" at "http://retronym.github.com/repo/snapshots"
addSbtPlugin("com.github.retronym" % "sbt-onejar" % "0.6")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议对上面的代码进行以下更改:
两行。
最后一行应为
oneJar 中的 mainClass := Some("Test")
如果您想为 oneJar-Plugin 使用另一个
mainClass
。如果与编译范围内的相同。你也可以这样写编译中的mainClass := Some("Test")
但不要同时指定两者。
您的项目目录结构应如下所示:
sbt 文件的实际名称并不重要,它们只需以 .sbt 结尾即可。
I would suggest the following changes to the code above:
into two lines.
The last line should read
mainClass in oneJar := Some("Test")
if you want to use another
mainClass
for the oneJar-Plugin. If it's the same as in the compile scope. You may as well write this asmainClass in Compile := Some("Test")
but do not specifiy both.
Your project directory structure should look like this:
the actual names of the sbt-files don't matter they just have to end in .sbt.