<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> <configuration> <archive> <manifest> <mainClass>com.citi.simpliciti.tempest.g10.util.TestMongo</mainClass> </manifest> <manifestEntries> <Specification-Title>${project.name}</Specification-Title> <Specification-Version>${project.version}</Specification-Version> <Implementation-Version>${build.number}</Implementation-Version> <Change>${project.version}</Change> <Build-Date>${maven.build.timestamp}</Build-Date> </manifestEntries> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.1</version> <configuration> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <!-- Refer to: https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer Some jars contain additional resources (such as properties files) that have the same file name. To avoid overwriting, you can opt to merge them by appending their content into one file. For example the spring-context-5.0.7.RELEASE.jar and spring-aop-5.0.7.RELEASE.jar both have spring.handlers. The spring aop jar's content is http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler The spring context jar's content is http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler With the AppendingTransformer they can be consolidated into one spring.handlers. Without AppendingTransformer, the former jar's handlers will be overwritten. In that case, some flow/topology submission will fail. --> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>