【问题标题】:How does one build a custom Bootstrap WebJar with sbt?如何使用 sbt 构建自定义 Bootstrap WebJar?
【发布时间】:2014-04-29 02:48:32
【问题描述】:

我想构建一个 WebJar,其中包含来自 LESS 源的品牌定制版 Bootstrap。我在project/build.properties 中有sbt.version=0.13.5-M4,在project/plugins.sbt 中有addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0-M2a")。我的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

我错过了什么?

【问题讨论】:

    标签: sbt webjars


    【解决方案1】:

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

    resolvers += Resolver.typesafeRepo("releases")
    

    https://github.com/sbt/sbt-less/issues/31 已废弃

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-17
      • 2014-09-08
      • 1970-01-01
      • 2016-08-04
      • 2019-04-08
      • 2023-02-24
      • 2014-12-05
      • 1970-01-01
      相关资源
      最近更新 更多