Add JARs from Hop web to the fat JAR
This is required for the JAR to work with Cloud Dataflow, and the issue probably happens with other runners too.
The directory only exists if this is running in Tomcat.
@@ -201,6 +201,12 @@ public class HopBeamGuiPlugin {
jarFiles.addAll(FileUtils.listFiles(new File("plugins"), new String[] {"jar"}, true));
+ // If we are in the hop-web Docker container, we need to import the Hop main JARs too for Dataflow
+ // (and for other runners probably too)
+ File hopWebJars = new File("webapps/ROOT/WEB-INF/lib");
+ if (hopWebJars.exists())
+ jarFiles.addAll(FileUtils.listFiles(hopWebJars, new String[] {"jar"}, true));
+
List<String> jarFilenames = new ArrayList<>();
jarFiles.forEach(file -> jarFilenames.add(file.toString()));
return jarFilenames;
