如何使用sbt构建自定义Bootstrap WebJar?

时间:2014-04-29 02:48:33

标签: sbt webjars

我想构建一个WebJar,其中包含来自LESS源的品牌定制版本的Bootstrap。我sbt.version=0.13.5-M4中的project/build.propertiesaddSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0-M2a")中的project/plugins.sbt。我的build.sbt看起来像这样:

import com.typesafe.web.sbt.WebPlugin
import com.typesafe.jse.sbt.JsEnginePlugin
import com.typesafe.web.sbt.WebPlugin.WebKeys

name := "brand-assets"

organization := "com.example"

version := "0.0.1-SNAPSHOT"

WebPlugin.webSettings

JsEnginePlugin.jsEngineSettings

lazy val root = (project in file(".")).addPlugins(SbtWeb)

excludeFilter in Assets := new PatternFilter("""[^_].*\.less""".r.pattern)

我得到的错误是:

build.sbt:1: error: object web is not a member of package com.typesafe
import com.typesafe.web.sbt.WebPlugin
                    ^
build.sbt:2: error: object sbt is not a member of package com.typesafe.jse
import com.typesafe.jse.sbt.JsEnginePlugin
                        ^
build.sbt:15: error: value addPlugins is not a member of sbt.Project
lazy val root = (project in file(".")).addPlugins(SbtWeb)
                                       ^
sbt.compiler.EvalException: Type error in expression

我错过了什么?

1 个答案:

答案 0 :(得分:0)

到目前为止,我了解您的问题,您应该将以下行添加到plugin.sbt

resolvers += Resolver.typesafeRepo("releases")

https://github.com/sbt/sbt-less/issues/31

中讨论过