From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit, gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command
---
src/com/gitblit/Launcher.java | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/com/gitblit/Launcher.java b/src/com/gitblit/Launcher.java
index 7865f24..a43331b 100644
--- a/src/com/gitblit/Launcher.java
+++ b/src/com/gitblit/Launcher.java
@@ -25,14 +25,20 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import com.gitblit.build.Build;
/**
- * Launch helper class that adds all jars found in the local "lib" folder and
- * then calls the application main. Using this technique we do not have to
- * specify a classpath and we can dynamically add jars to the distribution.
+ * Launch helper class that adds all jars found in the local "lib" & "ext"
+ * folders and then calls the application main. Using this technique we do not
+ * have to specify a classpath and we can dynamically add jars to the
+ * distribution.
+ *
+ * This class also downloads all runtime dependencies, if they are not found.
+ *
+ * @author James Moger
*
*/
public class Launcher {
@@ -52,6 +58,7 @@
+ protectionDomain.getCodeSource().getLocation().toExternalForm());
}
+ // download all runtime dependencies
Build.runtime();
// Load the JARs in the lib and ext folder
@@ -68,16 +75,23 @@
List<File> found = findJars(libFolder.getAbsoluteFile());
jars.addAll(found);
}
+ // sort the jars by name and then reverse the order so the newer version
+ // of the library gets loaded in the event that this is an upgrade
+ Collections.sort(jars);
+ Collections.reverse(jars);
if (jars.size() == 0) {
for (String folder : folders) {
File libFolder = new File(folder);
- System.err.println("Failed to find any JARs in " + libFolder.getPath());
+ // this is a test of adding a comment
+ // more really interesting things
+ System.err.println("Failed to find any really cool JARs in " + libFolder.getPath());
}
System.exit(-1);
} else {
for (File jar : jars) {
try {
+ jar.canRead();
addJarFile(jar);
} catch (Throwable t) {
t.printStackTrace();
@@ -107,6 +121,7 @@
}
}
}
+
return jars;
}
--
Gitblit v1.9.1