diff options
author | Simon Steiner <ssteiner@apache.org> | 2023-09-15 16:18:01 +0100 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2023-09-15 16:18:01 +0100 |
commit | 699b56779e89d45ae8d8ea517bc7cee57e2f4231 (patch) | |
tree | 0949205d76337f5d86eb0a824e8b5c6d9e96ef6d | |
parent | 7f01c67a96493fc5d6275a25414dd0841a2617b9 (diff) | |
download | xmlgraphics-fop-699b56779e89d45ae8d8ea517bc7cee57e2f4231.tar.gz xmlgraphics-fop-699b56779e89d45ae8d8ea517bc7cee57e2f4231.zip |
FOP-3150: Resolve classpath for binary distribution
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/cli/Main.java | 26 | ||||
-rw-r--r-- | fop/pom.xml | 1 |
2 files changed, 10 insertions, 17 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/cli/Main.java b/fop-core/src/main/java/org/apache/fop/cli/Main.java index a14d20c78..ca9443ade 100644 --- a/fop-core/src/main/java/org/apache/fop/cli/Main.java +++ b/fop-core/src/main/java/org/apache/fop/cli/Main.java @@ -27,6 +27,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; @@ -62,22 +63,18 @@ public final class Main { } else { buildDir = new File(baseDir, "build"); } - File fopJar = new File(buildDir, "fop.jar"); - if (!fopJar.exists()) { - fopJar = new File(baseDir, "fop.jar"); - } - if (!fopJar.exists()) { - throw new RuntimeException("fop.jar not found in directory: " - + baseDir.getAbsolutePath() + " (or below)"); - } - List jars = new java.util.ArrayList(); - jars.add(fopJar.toURI().toURL()); - File[] files; + List jars = new ArrayList(); FileFilter filter = new FileFilter() { public boolean accept(File pathname) { return pathname.getName().endsWith(".jar"); } }; + File[] files = buildDir.listFiles(filter); + if (files != null) { + for (File file : files) { + jars.add(file.toURI().toURL()); + } + } File libDir = new File(baseDir, "lib"); if (!libDir.exists()) { libDir = baseDir; @@ -97,12 +94,7 @@ public final class Main { } } } - URL[] urls = (URL[])jars.toArray(new URL[jars.size()]); - /* - for (int i = 0, c = urls.length; i < c; i++) { - System.out.println(urls[i]); - }*/ - return urls; + return (URL[])jars.toArray(new URL[jars.size()]); } /** diff --git a/fop/pom.xml b/fop/pom.xml index de896f2ba..5845e1f2c 100644 --- a/fop/pom.xml +++ b/fop/pom.xml @@ -47,6 +47,7 @@ <configuration> <archive> <manifest> + <addClasspath>true</addClasspath> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> <mainClass>org.apache.fop.cli.Main</mainClass> </manifest> |