diff --git a/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java b/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java index 5ab6350e729..a461b472a55 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/JarHell.java @@ -64,16 +64,23 @@ class JarHell { while (elements.hasMoreElements()) { String entry = elements.nextElement().getName(); if (entry.endsWith(".class")) { + // for jar format, the separator is defined as / + entry = entry.replace('/', '.').substring(0, entry.length() - 6); checkClass(clazzes, entry, url); } } } } else { - Files.walkFileTree(PathUtils.get(url.toURI()), new SimpleFileVisitor() { + // case for tests: where we have class files in the classpath + final Path root = PathUtils.get(url.toURI()); + final String sep = root.getFileSystem().getSeparator(); + Files.walkFileTree(root, new SimpleFileVisitor() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - String entry = file.toString(); + String entry = root.relativize(file).toString(); if (entry.endsWith(".class")) { + // normalize with the os separator + entry = entry.replace(sep, ".").substring(0, entry.length() - 6); checkClass(clazzes, entry, url); } return super.visitFile(file, attrs); @@ -85,10 +92,10 @@ class JarHell { @SuppressForbidden(reason = "proper use of URL to reduce noise") static void checkClass(Map clazzes, String clazz, URL url) { - if (clazz.startsWith("org/apache/log4j")) { + if (clazz.startsWith("org.apache.log4j")) { return; // go figure, jar hell for what should be System.out.println... } - if (clazz.equals("org/joda/time/base/BaseDateTime.class")) { + if (clazz.equals("org.joda.time.base.BaseDateTime")) { return; // apparently this is intentional... clean this up } URL previous = clazzes.put(clazz, url); diff --git a/plugins/cloud-azure/pom.xml b/plugins/cloud-azure/pom.xml index f6c8b42601e..ec48e39af91 100644 --- a/plugins/cloud-azure/pom.xml +++ b/plugins/cloud-azure/pom.xml @@ -44,6 +44,12 @@ governing permissions and limitations under the License. --> com.microsoft.azure azure-management-compute 0.7.0 + + + stax + stax-api + + com.microsoft.azure diff --git a/plugins/cloud-gce/pom.xml b/plugins/cloud-gce/pom.xml index 926a94a2dab..1640df98465 100644 --- a/plugins/cloud-gce/pom.xml +++ b/plugins/cloud-gce/pom.xml @@ -43,6 +43,12 @@ governing permissions and limitations under the License. --> com.google.apis google-api-services-compute ${google.gce.version} + + + com.google.guava + guava-jdk5 + +