maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r676756 - in /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo: DependencyManagementReport.java dependencies/renderer/DependencyManagementRenderer.java
Date Mon, 14 Jul 2008 22:47:50 GMT
Author: vsiveton
Date: Mon Jul 14 15:47:50 2008
New Revision: 676756

URL: http://svn.apache.org/viewvc?rev=676756&view=rev
Log:
o removed todo

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java?rev=676756&r1=676755&r2=676756&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependencyManagementReport.java
Mon Jul 14 15:47:50 2008
@@ -70,6 +70,11 @@
      */
     private List remoteRepositories;
 
+    /**
+     * Lazy instantiation for management dependencies.
+     */
+    private ManagementDependencies managementDependencies;
+
     // ----------------------------------------------------------------------
     // Public methods
     // ----------------------------------------------------------------------
@@ -89,13 +94,10 @@
     /** {@inheritDoc} */
     public void executeReport( Locale locale )
     {
-        ManagementDependencies dependencies = new ManagementDependencies( project.getDependencyManagement()
-            .getDependencies() );
-
         DependencyManagementRenderer r = new DependencyManagementRenderer( getSink(), locale,
i18n, getLog(),
-                                                                           dependencies,
artifactFactory,
-                                                                           mavenProjectBuilder,
remoteRepositories,
-                                                                           localRepository
);
+                                                                           getManagementDependencies(),
+                                                                           artifactFactory,
mavenProjectBuilder,
+                                                                           remoteRepositories,
localRepository );
         r.render();
     }
 
@@ -108,6 +110,29 @@
     /** {@inheritDoc} */
     public boolean canGenerateReport()
     {
-        return project.getDependencyManagement() != null;
+        return getManagementDependencies().hasDependencies();
+    }
+
+    // ----------------------------------------------------------------------
+    // Private methods
+    // ----------------------------------------------------------------------
+
+    private ManagementDependencies getManagementDependencies()
+    {
+        if ( managementDependencies != null )
+        {
+            return managementDependencies;
+        }
+
+        if ( project.getDependencyManagement() == null )
+        {
+            managementDependencies = new ManagementDependencies( null );
+        }
+        else
+        {
+            managementDependencies = new ManagementDependencies( project.getDependencyManagement().getDependencies()
);
+        }
+
+        return managementDependencies;
     }
 }

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java?rev=676756&r1=676755&r2=676756&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
Mon Jul 14 15:47:50 2008
@@ -112,7 +112,6 @@
         {
             startSection( getTitle() );
 
-            // TODO: should the report just be excluded?
             paragraph( getReportString( "report.dependencyManagement.nolist" ) );
 
             endSection();



Mime
View raw message