diff --git a/eclipse-distribution/common/html/nightly-generic-snippet.html b/eclipse-distribution/common/html/nightly-generic-snippet.html
index 0760785d9..8f8c976df 100644
--- a/eclipse-distribution/common/html/nightly-generic-snippet.html
+++ b/eclipse-distribution/common/html/nightly-generic-snippet.html
@@ -1,6 +1,6 @@
- - spring-tool-suite-4-@QUALIFIER@-@TARGET@-win32.win32.x86_64.7z.exe
+ - spring-tool-suite-4-@QUALIFIER@-@TARGET@-win32.win32.x86_64.self-extracting.jar
- spring-tool-suite-4-@QUALIFIER@-@TARGET@-win32.win32.x86_64.zip
- spring-tool-suite-4-@QUALIFIER@-@TARGET@-macosx.cocoa.x86_64.dmg
- spring-tool-suite-4-@QUALIFIER@-@TARGET@-linux.gtk.x86_64.tar.gz
diff --git a/eclipse-distribution/common/repackage-windows-zips.sh b/eclipse-distribution/common/repackage-windows-zips.sh
new file mode 100755
index 000000000..044225647
--- /dev/null
+++ b/eclipse-distribution/common/repackage-windows-zips.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#We are assuming this script will be called by bamboo from the root of the git repo
+set -ev
+echo "Repackaging Windows Distribution Zip files as self extracting jars..."
+cd eclipse-distribution
+echo pwd = $(pwd)
+find . -name "*.zip"
+for zipfile in $(find $(pwd) -name "*.win32.x86_64.zip"); do
+ java -jar commons/self-extracting-jar-creator.jar "$zipfile"
+done
+echo "Repackaging Windows Distribution Zip files DONE"
diff --git a/eclipse-distribution/common/self-extracting-jar-creator.jar b/eclipse-distribution/common/self-extracting-jar-creator.jar
new file mode 100644
index 000000000..bc177598e
Binary files /dev/null and b/eclipse-distribution/common/self-extracting-jar-creator.jar differ
diff --git a/self-extracting-jar-creator/README.md b/self-extracting-jar-creator/README.md
new file mode 100644
index 000000000..dc7bbf5a2
--- /dev/null
+++ b/self-extracting-jar-creator/README.md
@@ -0,0 +1,25 @@
+Self-extracting Jar Creator
+===========================
+
+Simple utility that creates self-extracting jars.
+
+Building
+--------
+
+Run `./build.sh` from the directory containing this readme.
+The creator utility is produced as `target/self-extracting-jar-creator-*.jar`.
+A copy of this file is also installed into eclipse-distributions/commons for
+use by the STS build.
+
+Creating a Self Extracting Jar
+------------------------------
+
+Run command `java -jar self-extracing-jar-creator/target/self-extracing-jar-creator-0.0.1-SNAPSHOT.jar `.
+The repackaged zip is created in the same directory as the original zip.
+
+Unpacking a Self Extracting Jar
+------------------------------
+
+Double-click the self extracting jar (this works only if your OS environment is setup to recognize executable jars and run them
+through a JVM, this seems to be the case in Windows if a JVM is installed). Alternatively, you can also unpack STS
+from the commandline via `java -jar `.
diff --git a/self-extracting-jar-creator/build.sh b/self-extracting-jar-creator/build.sh
new file mode 100755
index 000000000..5a3003549
--- /dev/null
+++ b/self-extracting-jar-creator/build.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+mvn clean package
+cp target/*.jar ../eclipse-distribution/common/self-extracting-jar-creator.jar
\ No newline at end of file
diff --git a/self-extracting-jar-creator/pom.xml b/self-extracting-jar-creator/pom.xml
index 44b5240d0..68f86712d 100644
--- a/self-extracting-jar-creator/pom.xml
+++ b/self-extracting-jar-creator/pom.xml
@@ -2,8 +2,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- com.github.kdvolder
- self-extracing-jar-creator
+ org.springframework.ide
+ self-extracting-jar-creator
0.0.1-SNAPSHOT
1.8
diff --git a/self-extracting-jar-creator/src/main/java/SelfExtractor.java b/self-extracting-jar-creator/src/main/java/SelfExtractor.java
index 1250caeaa..c99c57ad3 100644
--- a/self-extracting-jar-creator/src/main/java/SelfExtractor.java
+++ b/self-extracting-jar-creator/src/main/java/SelfExtractor.java
@@ -53,7 +53,7 @@ public class SelfExtractor {
try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(new File(repackagedPath)))) {
ZipEntry entry;
while ((entry = zipIn.getNextEntry())!=null) {
- System.out.println("Adding: "+entry.getName());
+ //System.out.println("Adding: "+entry.getName());
if (entry.getName().equals("contents.zip")) {
//skip. We need to write the wrapped zip contents here.
} else {
@@ -67,7 +67,7 @@ public class SelfExtractor {
} //end while
entry = new ZipEntry("contents.zip");
zipOut.putNextEntry(entry);
- System.out.println("Adding: "+entry.getName());
+ //System.out.println("Adding: "+entry.getName());
try (FileInputStream contentsZipIn = new FileInputStream(contentsZip)) {
copy(contentsZipIn, zipOut);
}
@@ -89,7 +89,8 @@ public class SelfExtractor {
String myResourceUrl = resource.toString();
//Example: jar:file:/home/.../self-extracing-jar-creator-0.0.1-SNAPSHOT.jar!/SelfExtractor.class
if (!myResourceUrl.startsWith("jar:file:")) {
- File devJar = new File("target/self-extracing-jar-creator-0.0.1-SNAPSHOT.jar");
+ //For convenience in 'development mode' look for a local jar built by maven.
+ File devJar = new File("target/self-extracting-jar-creator-0.0.1-SNAPSHOT.jar");
if (devJar.isFile()) {
return devJar;
}
@@ -101,7 +102,7 @@ public class SelfExtractor {
private ZipInputStream openContentsZip() {
InputStream zip = this.getClass().getResourceAsStream(CONTENTS_ZIP_RSRC);
if (zip==null) {
- throw new IllegalArgumentException("Couldn't find embedded '"+CONTENTS_ZIP_RSRC+"");
+ throw new IllegalArgumentException("Malformed archive: Couldn't find embedded '"+CONTENTS_ZIP_RSRC+"");
}
return new ZipInputStream(zip);
}