Github user srdo commented on a diff in the pull request: https://github.com/apache/storm/pull/2566#discussion_r170419284 --- Diff: storm-client/src/jvm/org/apache/storm/utils/Utils.java --- @@ -1504,36 +1505,53 @@ public static StormTopology addVersions(StormTopology topology) { Yaml yaml = new Yaml(new SafeConstructor()); Map<String, Object> defaultsConf = null; Map<String, Object> stormConf = null; + + // Based on how Java handles the classpath + // https://docs.oracle.com/javase/8/docs/technotes/tools/unix/classpath.html for (String part: cp) { File f = new File(part); - if (f.isDirectory()) { - if (defaultsConf == null) { - defaultsConf = readConfIgnoreNotFound(yaml, new File(f, "defaults.yaml")); + + if (f.getName().equals("*")) { + // wildcard is given in file + // in java classpath, '*' is expanded to all jar/JAR files in the directory + File dir = f.getParentFile(); + if (dir == null) { + // it happens when part is just '*' rather than denoting some directory + dir = new File("."); } - - if (stormConf == null) { - stormConf = readConfIgnoreNotFound(yaml, new File(f, "storm.yaml")); + + File[] jarFiles = dir.listFiles((dir1, name) -> name.endsWith(".jar") || name.endsWith(".JAR")); + + if (jarFiles != null) { + for (File jarFile : jarFiles) { + JarConfigReader jarConfigReader = new JarConfigReader(yaml, defaultsConf, stormConf, jarFile).readJar(); + defaultsConf = jarConfigReader.getDefaultsConf(); + stormConf = jarConfigReader.getStormConf(); + } } } else { --- End diff -- Nit: Looks like this block doesn't need to be at another level, I think the method could be written as if ... else if ... else if ...
---