我要发布一个zip文件使用SBT-本机发射到bintray。
我能够执行:
sbt publish
并将其发布主伪影(的.jar,Javadoc中,等等)。
我也能够执行:
sbt universal:packageBin
它产生的.zip文件。
然而,当我执行:
sbt universal:publish
它提供了以下错误:
[info] Wrote C:\src\ShExcala\target\scala-2.10\shexcala_2.10-0.0.1.pom
tar: Cannot execute remote shell: No such file or directory
tar: C\:\\Users\\Labra\\AppData\\Local\\Temp\\sbt_407249ba\\shexcala-0.0.1.tar: Cannot open: I/O error
tar: Error is not recoverable: exiting now
[trace] Stack trace suppressed: run last universal:packageZipTarball for the full output.
[error] (universal:packageZipTarball) Error tarballing
C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
看来,问题出在“万能:packageZipTarball”的任务,也给出了同样的错误。
我使用Windows和我检查,我有“焦油”,“XZ”和“压缩”安装。
我不会介意,只用现在公布的.zip,所以也许另一个解决办法是只知道我怎么可以配置SBT-本机打包,避免packageZipTarball任务。
该build.sbt定义是:
import sbt._
import sbt.Keys._
import AssemblyKeys._
import bintray.Plugin.bintraySettings
import bintray.Keys._
import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys._
lazy val root = project.in(file("."))//.settings(crossScalaVersions := Seq("2.10.4", "2.11.0"))
Build.sharedSettings
version := Build.currentVersion
libraryDependencies ++= Seq(
"org.specs2" %% "specs2" % "2.3.7" % "test"
, "org.scalatest" % "scalatest_2.10" % "2.0.1-SNAP" % "test"
, "commons-configuration" % "commons-configuration" % "1.7"
, "org.rogach" %% "scallop" % "0.9.5"
, "com.typesafe" % "config" % "1.0.1"
, "org.scala-lang" % "scala-compiler" % "2.10.2"
, "com.assembla.scala-incubator" % "graph-core_2.10" % "1.6.2"
, "org.apache.jena" % "jena-arq" % "2.10.1"
, "org.scalaz" % "scalaz-core_2.10" % "7.0.6"
, "es.weso" % "stateparser_2.10" % "0.0.1"
, "es.weso" % "wesin_2.10" % "0.0.1"
)
autoCompilerPlugins := true
seq(bintraySettings:_*)
Build.publishSettings
deploymentSettings
publishMavenStyle := true
// publish <<= publish.dependsOn(publish in config("universal"))
packageArchetype.java_application
resourceGenerators in Test += Def.task {
val location = url("https://github.com/shexSpec/test-suite/raw/gh-pages/tests.zip")
IO.unzipURL(location, resourceManaged.value / "downloadedTests").toSeq
}.taskValue
resolvers ++= Seq("snapshots", "releases").map(Resolver.sonatypeRepo)
和project/build.scala
是:
import sbt._
import sbt.Keys._
import bintray.Plugin.bintraySettings
import bintray.Keys._
import Def.ScopedKey
import scala.scalajs.sbtplugin.ScalaJSPlugin._
object Build extends sbt.Build {
val isRelease = true
def repo = "weso-releases"
val shExcalaVersion = "0.0.1"
publishMavenStyle := false
val currentVersion = shExcalaVersion
protected val bintrayPublishIvyStyle = settingKey[Boolean]("=== !publishMavenStyle")
lazy val publishSettings = Seq(
repository in bintray := this.repo,
bintrayOrganization in bintray := Some("weso"),
licenses += ("MPL-2.0", url("http://opensource.org/licenses/MPL-2.0")),
bintrayPublishIvyStyle := true
)
val sharedSettings = Seq(
organization := "es.weso",
name := "shExcala",
scalaVersion := "2.10.4"
)
}
输出last universal:packageZipTarball
是:
> last universal:packageZipTarball
java.lang.RuntimeException: Error tarballing C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
at scala.sys.package$.error(package.scala:27)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:134)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:118)
at sbt.IO$.withTemporaryDirectory(IO.scala:285)
at com.typesafe.sbt.packager.universal.Archives$.makeTarball(Archives.scala:118)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[error] (universal:packageZipTarball) Error tarballing C:\src\ShExcala\target\universal\shexcala-0.0.1.tgz. Exit code: 2
>