我正在一个java
play
项目中工作,并且sbt
作为构建工具。我有一个sbt-uglify
插件来减少我正在使用的资源。
这是我的plugins.sbt
文件
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "2.0.0" from "file:///tmp/dependencies/sbt/sbt-uglify.jar")
我要用来构建的机器没有互联网访问权限,因此我将sbt插件依赖项jar保留在了构建机器中的某个位置,并在plugins.sbt
中指定了路径。
请参见下面的build.sbt
文件
import com.typesafe.sbt.web.SbtWeb
name := """name"""
organization := "com.vts"
version := "1.0"
lazy val root = (project in file(".")).enablePlugins(PlayJava,SbtWeb).dependsOn( assemblyPlugin )
lazy val assemblyPlugin = uri("file:///tmp/dependencies/sbt/sbt-uglify.jar")
scalaVersion := "2.12.2"
libraryDependencies += guice
unmanagedClasspath in Compile += file("/tmp/file/*.jar")
uglifyCompressOptions := Seq("unused=false", "dead_code=false","warnings=false")
pipelineStages := Seq(uglify)
//pipelineStages in Assets := Seq(concat,cssCompress,uglify)
尝试构建项目时出现错误提示
build.sbt ::错误:找不到:值uglifyCompressOptions uglifyCompressOptions:= Seq(“ unused = false”,“ dead_code = false”, “ warnings = false”)^ [错误]表达式中键入错误
似乎没有得到我的依赖。我不确定自己做错了什么