For a Spark project I needed to bundle some dependencies and I found a few Stackoverflow answers that explained to add this section to your pom.xml:
<plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin>
But once I packaged my application I ended up with a huge jar file. It contained everything the application needed.
My mistake was that the pom.xml did not contain the proper scope for each dependency and because of that they were all getting bundled into the jar.
Specified that a few were provided (provided) and it reduced the jar size considerably.
How a small missing piece can change other behaviours drastically.