add support for having a WAR classpath entry in the classpath

This commit is contained in:
Richard Vowles committed 2013-05-03 20:05:07 +12:00
1 parent d8ac8e1694
commit 26a8af8c5b
1 file changed
+4 -1
@@ -87,7 +87,7 @@ public class XmlConfigLoader {
if (classPath.isDirectory()) {
checkDir(searchFor, xmlList, classPath);
} else if (classPath.getName().endsWith(".jar") || classPath.getName().endsWith(".war")) {
} else if (classPath.getName().endsWith(".jar") || classPath.getName().endsWith(".war") || classPath.getName().endsWith(".war!/WEB-INF/classes")) {
checkJar(searchFor, xmlList, classPath);
} else {
@@ -152,6 +152,9 @@ public class XmlConfigLoader {
if (fileName.toLowerCase().startsWith("surefire")){
return;
}
if (classPath.getAbsolutePath().endsWith(".war!/WEB-INF/classes")) {
classPath = new File(classPath.getAbsolutePath().substring(0, classPath.getAbsolutePath().lastIndexOf('!')));
}
JarFile module = null;
try {
module = new JarFile(classPath);