sbt汇编没有发布胖罐子

时间:2016-08-09 11:33:45

标签: sbt sbt-assembly

我可以sbt assembly自己是一个胖罐而不会出现以下build.sbt文件的问题。但是,当我尝试发布这个"胖jar"时,sbt publish仅在s3存储桶中转储1kb .jar文件。

解压缩.jar文件显示它只包含一个清单文件。

如何将胖罐放入我的仓库?

更新:自提出初始问题以来,已删除的文字已被更改。删除名称覆盖,它现在发布构建代码但没有外部库

下面,我的build.sbt文件

name := "util_myutil"

version := "1.0.1"

scalaVersion := "2.10.4"

scalacOptions += "-target:jvm-1.7"

libraryDependencies += "org.apache.spark" % "spark-core_2.10" % "1.5.0-cdh5.5.2" % "provided"

unmanagedJars in Compile += file(".lib/my.jar")
unmanagedJars in Compile += file(".lib/some_other.jar")


assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
汇编中的

assemblyJarName:= s" $ {name.value} - $ {version.value} .jar"

ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }

resolvers ++= Seq(
  "Cloudera repos" at "https://repository.cloudera.com/artifactory/cloudera-repos",
  "Cloudera releases" at "https://repository.cloudera.com/artifactory/libs-release",
  "Era7 maven releases" at "https://s3-eu-west-1.amazonaws.com/releases.era7.com"
)

s3sse := true
s3region := com.amazonaws.services.s3.model.Region.US_Standard
s3acl := com.amazonaws.services.s3.model.CannedAccessControlList.Private
s3overwrite := true
publishMavenStyle := true

publishTo := {
  val suffix = if (isSnapshot.value) "snapshots" else "releases"
  Some(s3resolver.value(s"IT Insights Artifacts $suffix", s3("my-mvn-repo." + suffix)))
}

1 个答案:

答案 0 :(得分:3)

来自https://github.com/sbt/sbt-assembly

将此添加到您的build.sbt:

-->