summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarko Grönroos <magi@iki.fi>2011-03-03 16:35:38 +0000
committerMarko Grönroos <magi@iki.fi>2011-03-03 16:35:38 +0000
commit0630118b928a7e0ddaaecb0843e9c0b819a43025 (patch)
tree7e191098a8569e30f9cfb7ee33548a0f875066ee /build
parent90683341534163ccbc695606b1f6cafa754a6438 (diff)
downloadvaadin-framework-0630118b928a7e0ddaaecb0843e9c0b819a43025.tar.gz
vaadin-framework-0630118b928a7e0ddaaecb0843e9c0b819a43025.zip
Close Jar before updating its manifest. Fixes #6045.
svn changeset:17592/svn branch:6.5
Diffstat (limited to 'build')
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java b/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java
index 742450f3d5..6f477601ed 100644
--- a/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java
+++ b/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java
@@ -92,6 +92,14 @@ public class GeneratePackageExports {
Name name = (Name) attrit.next();
keys.add(name.toString());
}
+
+ // Jar must be closed before updating it below, as it's
+ // locked in Windows until closed. (#6045)
+ try {
+ jar.close();
+ } catch (IOException e) {
+ System.err.println("Unable to close JAR '"+jarFilename+"'");
+ }
// Put the manifest version as the first line
String orderedKeys[] = new String[keys.size()];
@@ -121,7 +129,8 @@ public class GeneratePackageExports {
// the loop above, but it's not guaranteed that it exists.
manifest.writeAttribute("Export-Package", exportPackage);
- // Update the manifest in the Jar
+ // Update the manifest in the Jar. The jar must be closed
+ // before this is done.
int status = manifest.updateJar(jarFilename);
if (status != 0)