public class JarHell
extends java.lang.Object
This class checks for incompatibilities in the following ways:
X-Compile-Target-JDK value in the jar
manifest is compatible with current JREX-Compile-Elasticsearch-Version value in
the jar manifest is compatible with the current ES| Modifier and Type | Method | Description |
|---|---|---|
static void |
checkJarHell(java.util.function.Consumer<java.lang.String> output) |
Checks the current classpath for duplicate classes
|
static void |
checkJarHell(java.util.Set<java.net.URL> urls,
java.util.function.Consumer<java.lang.String> output) |
Checks the set of URLs for duplicate classes
|
static void |
checkJavaVersion(java.lang.String resource,
java.lang.String targetVersion) |
Checks that the java specification version
targetVersion
required by resource is compatible with the current installation. |
static void |
checkVersionFormat(java.lang.String targetVersion) |
|
static void |
main(java.lang.String[] args) |
Simple driver class, can be used eg.
|
static java.util.Set<java.net.URL> |
parseClassPath() |
Parses the classpath into an array of URLs
|
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic static void checkJarHell(java.util.function.Consumer<java.lang.String> output)
throws java.io.IOException,
java.net.URISyntaxException
output - A String Consumer to which debug output will be sentjava.lang.IllegalStateException - if jar hell was foundjava.io.IOExceptionjava.net.URISyntaxExceptionpublic static java.util.Set<java.net.URL> parseClassPath()
java.lang.IllegalStateException - if the classpath contains empty elementspublic static void checkJarHell(java.util.Set<java.net.URL> urls,
java.util.function.Consumer<java.lang.String> output)
throws java.net.URISyntaxException,
java.io.IOException
urls - A set of URLs from the classpath to be checked for conflicting jarsoutput - A String Consumer to which debug output will be sentjava.lang.IllegalStateException - if jar hell was foundjava.net.URISyntaxExceptionjava.io.IOExceptionpublic static void checkVersionFormat(java.lang.String targetVersion)
public static void checkJavaVersion(java.lang.String resource,
java.lang.String targetVersion)
targetVersion
required by resource is compatible with the current installation.