Usage Maven Plugin

USAGE MAVEN PLUGIN Simple plugin with two goals: usage:class For search substring for class-name in code and collect statistics after walking by dependency tree usage:resource For search substring for resource-name in dependency tree Both goals return json result into log

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.usalko
ArtifactId

ArtifactId

usage-maven-plugin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Usage Maven Plugin
USAGE MAVEN PLUGIN Simple plugin with two goals: usage:class For search substring for class-name in code and collect statistics after walking by dependency tree usage:resource For search substring for resource-name in dependency tree Both goals return json result into log

Download usage-maven-plugin

How to add to project

<plugin>
    <groupId>com.usalko</groupId>
    <artifactId>usage-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Dependencies

compile (8)

Group / Artifact Type Version
org.apache.maven : maven-artifact jar 3.0
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-model jar 3.0
org.apache.maven : maven-core jar 3.0
org.apache.maven : maven-repository-metadata jar 3.0
org.apache.maven.shared : maven-dependency-tree jar 3.0
org.apache.maven.shared : maven-common-artifact-filters jar 3.1.0
org.ow2.asm : asm jar 7.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-tools-annotations jar 3.6.0

test (13)

Group / Artifact Type Version
org.apache.maven.shared : file-management jar 3.0.0
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-tools jar 3.1.0
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.1.0
org.codehaus.plexus : plexus-interpolation jar 1.24
org.jetbrains.kotlin : kotlin-stdlib jar 1.3.50
org.apache.maven.resolver : maven-resolver-api jar 1.0.3
org.apache.maven.resolver : maven-resolver-transport-file jar 1.0.3
org.apache.maven.resolver : maven-resolver-connector-basic jar 1.0.3
org.apache.maven.resolver : maven-resolver-transport-http jar 1.0.3
org.apache.xbean : xbean-reflect jar 4.14
org.apache.maven : maven-compat jar 3.0
org.eclipse.sisu : org.eclipse.sisu.plexus jar 0.0.0.M5

Project Modules

There are no modules declared in this project.
USAGE MAVEN PLUGIN

Simple plugin with two goals:

  • usage:class For search substring for class-name in code and collect statistics after walking by dependency tree
  • usage:resource For search substring for resource-name in dependency tree

Both goals return json result into log

Example for class goal, if you apply in this project directory:

mvn com.usalko:usage-maven-plugin:class -DclassName=LoggerFactory

Output will be include json:

[INFO] {"usage-class": [{"artifact":"org.apache.maven.resolver:maven-resolver-transport-file:jar:1.0.3:test","entry":"org/eclipse/aether/transport/file/FileTransporterFactory:6"},
 {"artifact":"org.apache.maven.resolver:maven-resolver-spi:jar:1.0.3:test","entry":"org/eclipse/aether/spi/log/NullLoggerFactory:11"},
 {"artifact":"org.apache.maven.resolver:maven-resolver-connector-basic:jar:1.0.3:test","entry":"org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory:6"},
 {"artifact":"org.apache.maven.resolver:maven-resolver-transport-http:jar:1.0.3:test","entry":"org/eclipse/aether/transport/http/HttpTransporterFactory:6"},
 {"artifact":"org.slf4j:jcl-over-slf4j:jar:1.6.2:test","entry":"org/apache/commons/logging/impl/SLF4JLocationAwareLog:1"},
 {"artifact":"org.slf4j:jcl-over-slf4j:jar:1.6.2:test","entry":"org/apache/commons/logging/impl/SLF4JLog:1"},
 {"artifact":"org.slf4j:jcl-over-slf4j:jar:1.6.2:test","entry":"org/apache/commons/logging/impl/SLF4JLogFactory:1"},
 {"artifact":"org.slf4j:slf4j-api:jar:1.6.2:test","entry":"org/slf4j/helpers/NamedLoggerBase:1"},
 {"artifact":"org.slf4j:slf4j-api:jar:1.6.2:test","entry":"org/slf4j/helpers/NOPLoggerFactory:2"},
 {"artifact":"org.slf4j:slf4j-api:jar:1.6.2:test","entry":"org/slf4j/helpers/SubstituteLoggerFactory:8"},
 {"artifact":"org.slf4j:slf4j-api:jar:1.6.2:test","entry":"org/slf4j/LoggerFactory:47"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:test","entry":"org/codehaus/plexus/DefaultPlexusContainer$SLF4JLoggerFactoryProvider:5"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:test","entry":"org/codehaus/plexus/DefaultPlexusContainer:3"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/plexus/PlexusLifecycleManager:3"},
 {"artifact":"org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:test","entry":"com/google/inject/internal/InjectorShell$LoggerFactory:11"},
 {"artifact":"org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:test","entry":"com/google/inject/internal/InjectorShell$SLF4JLoggerFactory:25"},
 {"artifact":"org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:test","entry":"com/google/inject/internal/InjectorShell:8"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/inject/Logs$SLF4JSink:1"}]}

Example for resource goal, if you apply in this project directory:

mvn com.usalko:usage-maven-plugin:resource -DresourceName=package-info

Output will be include json:

[INFO] {"usage-resource": [{"artifact":"org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/plexus/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/collect/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/cache/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/base/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/net/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/io/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/primitives/package-info.class"},
 {"artifact":"com.google.guava:guava:jar:10.0.1:test","entry":"com/google/common/util/concurrent/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/bean/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/inject/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/launch/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/space/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/eclipse/sisu/wire/package-info.class"},
 {"artifact":"org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M5:test","entry":"org/sonatype/inject/package-info.class"}]}s

Versions

Version
1.0