The compare-dependencies goal can be used to compare the dependencies in the current project to the dependencyManagement of a remote project. This is useful, for example, for finding differences between the current project dependencies and an organizational bill of materials (BOM) pom. You specify the remote groupId, artifactId, and the version to which the current project should be compared, for example
mvn versions:compare-dependencies -DremotePom=org.foo:bom-pom:1.0
By default the list of dependency differences will be output to the command line. This can be written to a file using the "reportOutputFile" parameter.
mvn versions:compare-dependencies -DremotePom=org.foo:bom-pom:1.0 -DreportOutputFile=${project.build.directory}/depDiffs.txt
The plugin can also automatically update the dependencies of the current project to match the remote project using the "updateDependencies" parameter. By default this is turned off.
mvn versions:compare-dependencies -DremotePom=org.foo:bom-pom:1.0 -DupdateDependencies=true