List<String> (final String mavenHome) { File mavenHomeBootAsFile = new File(new File(mavenHome, "core"), "boot"); // if the dir "core/boot" does not exist we are using a Maven version > 2.0.5 // in this case the classpath must be constructed from the dir "boot" if (!mavenHomeBootAsFile.exists()) { mavenHomeBootAsFile = new File(mavenHome, "boot"); } List<String> classpathEntries = new ArrayList<>(); File[] files = mavenHomeBootAsFile.listFiles(); if (files != null) { for (File file : files) { if (file.getName().contains("classworlds")) { classpathEntries.add(file.getAbsolutePath()); } } } return classpathEntries; }