GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - antonsjava/deps-size-plugin: maven plugin for calculating artifacts size

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
src/main/java/sk/antons/dsize
src/main/java/sk/antons/dsize
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

deps-size-plugin

Maven plugin for calculating artifacts size.

It is similar to dependency:tree but prints also size of artifact. Artifact is displayed like "org.slf4j:slf4j-api:jar:1.7.36 <41.125, 41.125>" where first number is size of artifact jar and second one is calculated sum of dependences (by default with runtime scope).

Calculated sum can be wrong as same artifact can be more time counted in dependence tree. Also single jar packaging can duplicate size.

But it is useful to identify candidates to exclude from class path.

Example for this plugin

[INFO] io.github.antonsjava:deps-size-plugin:maven-plugin:1.0 <21.345, 250.907>
[INFO] +- org.apache.maven.shared:maven-dependency-tree:jar:3.2.1 <42.608, 229.562>
[INFO]    +- org.eclipse.aether:aether-util:jar:1.0.0.v20140518 <145.829, 145.829>
[INFO]    +- org.slf4j:slf4j-api:jar:1.7.36 <41.125, 41.125>

usage

tree view (scope=runtime, order by brutto size)

mvn io.github.antonsjava:deps-size-plugin::tree 

list view (scope=runtime, order by brutto size)

mvn io.github.antonsjava:deps-size-plugin::list 

You can change sort by netto by -Dnetto=true param

You can set another scope by -Dscope=compile. Possible scopes are 'runtime' (default), 'compile+runtime', 'test', 'compile', 'runtime+system', 'provided', 'system', 'import'.

or you can define script like


#!/bin/bash

function helpinfo() {
	echo "Prints <netto size, brutto size> of depended artifacts "
	echo "Netto size is size of jar file in local repo. Brutto size "
	echo "is sum of brutto size of dependaces. Real sum can be less" 
	echo "because same artifact can be counted more than one time." 
	echo ""
	echo "Usage:"
	echo "  mvn-size.sh [-h|--help] [-list] [-netto] [-Dscope=<scope>]"
	echo "    -h|--help prints help"
	echo "    -list prints list instead of tree"
	echo "    -netto sort by netto size instead of cumulated"
	echo "    -Dscope=<scope> define scope for resolving artifacts"
	echo "       scope can be 'runtime' (default), 'compile+runtime'"
	echo "       'test', 'compile', 'runtime+system', 'provided'"
	echo "       'system', 'import'"
}

param1=$1
param2=$2

params=
name=tree

while [ "$#" -gt 0 ]; do
  case "$1" in
    -h) helpinfo; exit 1;;
    --help) helpinfo; exit 1;;
    -list) name=list; shift 1;;
    -netto) params="$params -Dnetto=true"; shift 1;;
    *) params="$params $1"; shift 1;;
  esac
done

echo "starting"
echo "mvn io.github.antonsjava:deps-size::$name $params"
mvn io.github.antonsjava:deps-size-plugin::$name $params

About

maven plugin for calculating artifacts size

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.