dependency:analyze-only

Full name:

org.apache.maven.plugins:maven-dependency-plugin:3.3.0:analyze-only

Description:

Analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared. This goal is intended to be used in the build lifecycle, thus it assumes that the test-compile phase has been executed - use the dependency:analyze goal instead when running standalone.

By default, maven-dependency-analyzer is used to perform the analysis, with limitations due to the fact that it works at bytecode level, but any analyzer can be plugged in through analyzer parameter.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.0.
  • Binds by default to the lifecycle phase: verify.

Optional Parameters

Name Type Since Description
<analyzer> String 2.2 Specify the project dependency analyzer to use (plexus component role-hint). By default, maven-dependency-analyzer is used. To use this, you must declare a dependency for this plugin that contains the code for the analyzer. The analyzer must have a declared Plexus role name, and you specify the role name here.
Default value is: default.
User property is: analyzer.
<failOnWarning> boolean 2.0 Whether to fail the build if a dependency warning is found.
Default value is: false.
User property is: failOnWarning.
<ignoreNonCompile> boolean 2.0 Ignore Runtime/Provided/Test/System scopes for unused dependency analysis. Non-test scoped list will be not affected.
Default value is: false.
User property is: ignoreNonCompile.
<ignoreUnusedRuntime> boolean 2.0 Ignore Runtime scope for unused dependency analysis.
Default value is: false.
User property is: ignoreUnusedRuntime.
<ignoredDependencies> String[] 2.10 List of dependencies that will be ignored. Any dependency on this list will be excluded from the "declared but unused", the "used but undeclared", and the "non-test scoped" list. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.


<ignoredNonTestScopedDependencies> String[] 3.3.0 List of dependencies that will be ignored if they are in not test scope but are only used in test classes. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.


<ignoredPackagings> List 3.2.1 List of project packaging that will be ignored.
Default value is: pom, ear
<ignoredUnusedDeclaredDependencies> String[] 2.10 List of dependencies that will be ignored if they are declared but unused. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.


<ignoredUsedUndeclaredDependencies> String[] 2.10 List of dependencies that will be ignored if they are used but undeclared. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.


<outputXML> boolean 2.0-alpha-5 Output the xml for the missing dependencies (used but not declared).
Default value is: false.
User property is: outputXML.
<scriptableFlag> String 2.0-alpha-5 Flag to use for scriptable output.
Default value is: $$$%%%.
User property is: scriptableFlag.
<scriptableOutput> boolean 2.0-alpha-5 Output scriptable values for the missing dependencies (used but not declared).
Default value is: false.
User property is: scriptableOutput.
<skip> boolean 2.7 Skip plugin execution completely.
Default value is: false.
User property is: mdep.analyze.skip.
<usedDependencies> String[] 2.6 Force dependencies as used, to override incomplete result caused by bytecode-level analysis. Dependency format is groupId:artifactId.
<verbose> boolean 2.0 Output used dependencies.
Default value is: false.
User property is: verbose.

Parameter Details

<analyzer>

Specify the project dependency analyzer to use (plexus component role-hint). By default, maven-dependency-analyzer is used. To use this, you must declare a dependency for this plugin that contains the code for the analyzer. The analyzer must have a declared Plexus role name, and you specify the role name here.
  • Type: java.lang.String
  • Since: 2.2
  • Required: No
  • User Property: analyzer
  • Default: default

<failOnWarning>

Whether to fail the build if a dependency warning is found.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: failOnWarning
  • Default: false

<ignoreNonCompile>

Ignore Runtime/Provided/Test/System scopes for unused dependency analysis. Non-test scoped list will be not affected.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: ignoreNonCompile
  • Default: false

<ignoreUnusedRuntime>

Ignore Runtime scope for unused dependency analysis.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: ignoreUnusedRuntime
  • Default: false

<ignoredDependencies>

List of dependencies that will be ignored. Any dependency on this list will be excluded from the "declared but unused", the "used but undeclared", and the "non-test scoped" list. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.

  • Type: java.lang.String[]
  • Since: 2.10
  • Required: No

<ignoredNonTestScopedDependencies>

List of dependencies that will be ignored if they are in not test scope but are only used in test classes. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.

  • Type: java.lang.String[]
  • Since: 3.3.0
  • Required: No

<ignoredPackagings>

List of project packaging that will be ignored.
Default value is: pom, ear
  • Type: java.util.List
  • Since: 3.2.1
  • Required: No

<ignoredUnusedDeclaredDependencies>

List of dependencies that will be ignored if they are declared but unused. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.

  • Type: java.lang.String[]
  • Since: 2.10
  • Required: No

<ignoredUsedUndeclaredDependencies>

List of dependencies that will be ignored if they are used but undeclared. The filter syntax is:
[groupId]:[artifactId]:[type]:[version]
where each pattern segment is optional and supports full and partial * wildcards. An empty pattern segment is treated as an implicit wildcard. *

For example, org.apache.* will match all artifacts whose group id starts with org.apache., and :::*-SNAPSHOT will match all snapshot artifacts.

  • Type: java.lang.String[]
  • Since: 2.10
  • Required: No

<outputXML>

Output the xml for the missing dependencies (used but not declared).
  • Type: boolean
  • Since: 2.0-alpha-5
  • Required: No
  • User Property: outputXML
  • Default: false

<scriptableFlag>

Flag to use for scriptable output.
  • Type: java.lang.String
  • Since: 2.0-alpha-5
  • Required: No
  • User Property: scriptableFlag
  • Default: $$$%%%

<scriptableOutput>

Output scriptable values for the missing dependencies (used but not declared).
  • Type: boolean
  • Since: 2.0-alpha-5
  • Required: No
  • User Property: scriptableOutput
  • Default: false

<skip>

Skip plugin execution completely.
  • Type: boolean
  • Since: 2.7
  • Required: No
  • User Property: mdep.analyze.skip
  • Default: false

<usedDependencies>

Force dependencies as used, to override incomplete result caused by bytecode-level analysis. Dependency format is groupId:artifactId.
  • Type: java.lang.String[]
  • Since: 2.6
  • Required: No

<verbose>

Output used dependencies.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: verbose
  • Default: false