I am trying to create a Gradle project that contains a Storm project. To run this project on Storm, I must first create a JAR file and let Storm run my topology, for example.
storm jar myJarFile.jar com.mypackage.MyStormMainClass
I have problems because Gradle, by default, includes Storm dependencies both at compile time and at runtime. This throws 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.
This exception is really helpful and tells us the root cause of the problem. The solution is to include Storm dependencies when compiling with Gradle, but not when creating the final JAR file.
Does anyone know how to solve this? Other posts in StackOverflow did not solve the problem. If you embed code, make sure it really works.
Thanks!
source share