diff --git a/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/jarlist/JarLister.java b/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/jarlist/JarLister.java
index a9de1ec87..7e3dc0cdb 100644
--- a/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/jarlist/JarLister.java
+++ b/utilities/buildutils/src/edu/cornell/mannlib/vitro/utilities/jarlist/JarLister.java
@@ -2,12 +2,17 @@
package edu.cornell.mannlib.vitro.utilities.jarlist;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
@@ -65,24 +70,42 @@ public class JarLister {
*
*
*
+ *
*
*
*
*
*/
- private static final String[] KNOWN_DEPENDENCIES = {
- "mysql-connector-java-5.1.16-bin.jar", "commons-logging-1.1.1.jar" };
-
private final String topJar;
private final String libDirectory;
+ private final List knownDependencies;
private final Map> dependencyMap = new HashMap>();
private final Set dependencySet = new TreeSet();
- public JarLister(String[] args) {
+ public JarLister(String[] args) throws IOException {
topJar = args[0];
libDirectory = args[1];
+ knownDependencies = Collections
+ .unmodifiableList(readKnownDependencies(args[2]));
+ }
+
+ private List readKnownDependencies(String knownDependenciesFilename)
+ throws IOException {
+ List list = new ArrayList();
+
+ BufferedReader r = new BufferedReader(new FileReader(
+ knownDependenciesFilename));
+
+ String line;
+ while (null != (line = r.readLine())) {
+ line = line.trim();
+ if (!(line.startsWith("#") || line.isEmpty())) {
+ list.add(line);
+ }
+ }
+ return list;
}
public void runDepFind() throws IOException {
@@ -113,7 +136,7 @@ public class JarLister {
String topJarName = new File(topJar).getName();
addDependenciesFor(topJarName);
- for (String known : KNOWN_DEPENDENCIES) {
+ for (String known : knownDependencies) {
dependencySet.add(known);
addDependenciesFor(known);
}
@@ -136,7 +159,7 @@ public class JarLister {
w.println("--------------------");
w.println("Known required JARs");
w.println("--------------------");
- for (String d : KNOWN_DEPENDENCIES) {
+ for (String d : knownDependencies) {
w.println(" " + d);
}
w.println();
diff --git a/webapp/build.xml b/webapp/build.xml
index 78c292bbe..4478211cd 100644
--- a/webapp/build.xml
+++ b/webapp/build.xml
@@ -343,6 +343,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
+
diff --git a/webapp/config/jarlist/known_dependencies.txt b/webapp/config/jarlist/known_dependencies.txt
new file mode 100644
index 000000000..87000a9e5
--- /dev/null
+++ b/webapp/config/jarlist/known_dependencies.txt
@@ -0,0 +1,24 @@
+#
+# A list of JARs that we know to be required by the source code (and notes on where they are required).
+#
+# The "jarlist" target of the build script will work on the assumption that these JARs and any JARs
+# that they depend on are required by the app.
+#
+# For example, the JDBC drivers are never explicitly included, but instead are invoked using Class.forName(),
+# so they are required even though the "jarlist" target won't find any such requirement.
+#
+
+# JDBC drivers that we want to include.
+# Oracle and MySQL
+ojdbc14_g.jar
+mysql-connector-java-5.1.16-bin.jar
+
+# Don't know who requires the Commons Logging package - Maybe JENA?
+commons-logging-1.1.1.jar
+
+# Needed by a variety of JSPs
+# datapropertyBackButtonProblems.jsp
+# n3Delete.jsp
+# processDatapropRdfForm.jsp
+# processRdfForm2.jsp
+xstream-1.2.2.jar
\ No newline at end of file