I am trying to build a Gradle project which contains a Storm project. In order to run this project on Storm, I have to first create a JAR file and let Storm run my topology, e.g.
storm jar myJarFile.jar com.mypackage.MyStormMainClass
I am running into problems because Gradle, by default, is including the Storm dependencies both at compile time and runtime. This causes the following exception:
Exception in thread "main" java.lang.RuntimeException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar.
The Exception given is actually helpful, and tips us off to the root cause of the problem. The solution is to include the Storm dependencies when compiling with Gradle, but not when generating the final JAR file.
Does anyone know how to resolve this? The other posts on StackOverflow did not solve the problem. If you paste code please ensure that it actually runs.
Thanks!