diff --git a/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java b/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java index 166fa709b5..5b1907b6e0 100644 --- a/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java +++ b/src/main/java/org/codehaus/mojo/versions/DependencyUpdatesReport.java @@ -47,6 +47,15 @@ public class DependencyUpdatesReport extends AbstractVersionsReport { + + /** + * Whether to process the dependencyManagement section of the project. If not set will default to true. + * + * @parameter property="processDependencyManagement" defaultValue="true" + * @since 2.4-SNAPSHOT + */ + protected Boolean processDependencyManagement = Boolean.TRUE; + /** * {@inheritDoc} */ @@ -84,8 +93,12 @@ protected void doGenerateReport( Locale locale, Sink sink ) { Map dependencyUpdates = getHelper().lookupDependenciesUpdates( dependencies, false ); - Map dependencyManagementUpdates = - getHelper().lookupDependenciesUpdates( dependencyManagement, false ); + + Map dependencyManagementUpdates = Collections.emptyMap(); + if(isProcessingDependencyManagement()) + { + dependencyManagementUpdates = getHelper().lookupDependenciesUpdates(dependencyManagement, false); + } DependencyUpdatesRenderer renderer = new DependencyUpdatesRenderer( sink, getI18n(), getOutputName(), locale, dependencyUpdates, dependencyManagementUpdates ); @@ -149,4 +162,9 @@ public String getOutputName() return "dependency-updates-report"; } + public boolean isProcessingDependencyManagement() + { + // true if true or null + return !Boolean.FALSE.equals( processDependencyManagement ); + } } \ No newline at end of file