I save a small pom.xml template on my workstation to identify heavy dependencies.
Assuming you want to see the weight of org.eclipse.jetty: the jetty client with all its transits creates this in a new folder.
<project> <modelVersion>4.0.0</modelVersion> <groupId>not-used</groupId> <artifactId>fat</artifactId> <version>standalone</version> <dependencies> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-client</artifactId> <version>LATEST</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
Then cd to the folder and run the mvn package and check the size of the generated fat can. On Unix-like systems, you can use du -h target/fat-standalone.jar to do this.
To test another maven artifact, simply change groupId:artifactId in the above template.
source share