Comments (9)
Yeah. If something was touching files in the directory where we were zipping, that might happen....
Any ideas on what was going on the same time this task was running?
from sbt-native-packager.
As far as I'm aware, nothing.
from sbt-native-packager.
Maybe I'm doing something wrong, but I'm reliably having this problem when trying to use the universal packager in a subproject. Minimal repro has the following directory structure,
./foo
./foo/conf
./foo/conf/foo.conf
./project
./project/Build.scala
./project/plugins.sbt
with this Build.scala file:
import sbt._
import Keys._
import com.typesafe.sbt.SbtNativePackager
import com.typesafe.sbt.SbtNativePackager._
object Foo extends Build {
val buildSettings = Defaults.defaultSettings ++ Seq (
organization := "foo",
scalaVersion := "2.10.2"
)
lazy val foo = Project(
base = file("foo"),
id = "foo",
settings = buildSettings ++
SbtNativePackager.packagerSettings ++
Seq( mappings in Universal := Seq(file("conf/foo.conf") -> "conf/foo.conf")
)
)
}
running universal:packageBin in the subproject fails:
[eus-loaner-22] [02:17 PM] [sb] > sbt
[info] Loading global plugins from /Users/gregj/.sbt/0.13/plugins
[info] Loading project definition from /Users/gregj/scratch/sb/project
[info] Compiling 1 Scala source to /Users/gregj/scratch/sb/project/target/scala-2.10/sbt-0.13/classes...
[info] Set current project to sb (in build file:/Users/gregj/scratch/sb/)
> project foo
[info] Set current project to foo (in build file:/Users/gregj/scratch/sb/)
> universal:packageBin
[trace] Stack trace suppressed: run 'last foo/universal:packageBin' for the full output.
[error] (foo/universal:packageBin) java.io.IOException: This archives contains unclosed entries.
[error] Total time: 0 s, completed Nov 6, 2013 2:17:59 PM
> last foo/universal:packageBin
java.io.IOException: This archives contains unclosed entries.
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:413)
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:806)
at com.typesafe.sbt.packager.universal.ZipHelper$.withZipOutput(ZipHelper.scala:107)
at com.typesafe.sbt.packager.universal.ZipHelper$.archive(ZipHelper.scala:87)
at com.typesafe.sbt.packager.universal.ZipHelper$.zip(ZipHelper.scala:53)
at com.typesafe.sbt.packager.universal.Archives$.makeZip(Archives.scala:15)
at com.typesafe.sbt.packager.universal.UniversalPlugin$$anonfun$com$typesafe$sbt$packager$universal$UniversalPlugin$$makePackageSettingsForConfig$1.apply(UniversalPlugin.scala:31)
at com.typesafe.sbt.packager.universal.UniversalPlugin$$anonfun$com$typesafe$sbt$packager$universal$UniversalPlugin$$makePackageSettingsForConfig$1.apply(UniversalPlugin.scala:31)
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.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[error] (foo/universal:packageBin) java.io.IOException: This archives contains unclosed entries.
from sbt-native-packager.
What OS are you using? I'll have to try it on something non-ubuntu....
from sbt-native-packager.
I'm on OSX 10.9
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
from sbt-native-packager.
FWIW, I suffered from the same problem with "This archives contains unclosed entries." when running play dist. It turned out that it happened because of broken symlink in my dist directory.
from sbt-native-packager.
I eventually figured this out, that the mappings aren't being resolved against the base directory of the subproject, rather against the base directory of the containing project, so where
Seq( mappings in Universal := Seq(file("conf/foo.conf") -> "conf/foo.conf")
was generating this error,
Seq( mappings in Universal := Seq(baseDirectory.value / "conf/foo.conf" -> "conf/foo.conf")
works. Seems in general that the packager errors out this way if the mapped input file doesn't exist. Which is logical, but the failure isn't informative of that.
from sbt-native-packager.
Wow, great find! Ill see if I can improve the erroring there.
from sbt-native-packager.
Closing this one as resolved with #83
from sbt-native-packager.
Related Issues (20)
- Unable to use the plugin - Error downloading com.typesafe.sbt:sbt-native-packager;sbtVersion=1.0;scalaVersion=2.12:1.9.4 HOT 6
- Duplicate identifiers for generated application scripts in WiX when JDKPackagerPlugin enabled
- missing jar for one sbt module HOT 1
- MacOS .pkg application do not start after installing. "Extensions" file missing from app bundle HOT 1
- Docker build steps marked as [error] but build completes HOT 2
- How to get dynamic jar files into docker HOT 1
- Will potential removal of custom (i.e. not compile/test) in sbt have adverse effect for sbt-native-packager HOT 2
- Packages are not available HOT 4
- GraalVMNativeImagePlugin ignores resources in src/graal
- Native image executable: could not find or load main class HOT 1
- dockerBuildInit doesn't work HOT 1
- Multiplatform builds do not always use buildx
- Changes Not Being Propagated to Image HOT 2
- Getting started description is outdated HOT 5
- Support for Podman as Docker alternative
- generated runit script no_more_snp_opts usage missing $ sign
- sbt docker:publishLocal logs build info as error HOT 1
- No releases for v1.9.17 or v1.9.18 tags HOT 44
- ARM architecture support HOT 2
- plugin load failed with Scala 3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-native-packager.