maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r676745 - in /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies: RepositoryUtils.java renderer/DependenciesRenderer.java
Date Mon, 14 Jul 2008 21:29:25 GMT
Author: vsiveton
Date: Mon Jul 14 14:29:25 2008
New Revision: 676745

URL: http://svn.apache.org/viewvc?rev=676745&view=rev
Log:
o getDependencyUrlFromRepository() could return null if the repo is blacklisted
o display stacktrace for error logs in getDependencyUrlFromRepository() only if log is in
debug mode

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

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java?rev=676745&r1=676744&r2=676745&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/RepositoryUtils.java
Mon Jul 14 14:29:25 2008
@@ -315,10 +315,15 @@
      * @param artifact not null
      * @param repo not null
      * @return the artifact url in the given repo for the given artifact. If it is a snapshot
artifact, the version
-     * will be the the timestamp and the build number from the metadata.
+     * will be the timestamp and the build number from the metadata. Could return null if
the repo is blacklisted.
      */
     public String getDependencyUrlFromRepository( Artifact artifact, ArtifactRepository repo
)
     {
+        if ( repo.isBlacklisted() )
+        {
+            return null;
+        }
+
         Artifact copyArtifact = ArtifactUtils.copyArtifact( artifact );
         // Try to get the last artifact repo name depending the snapshot version
         if ( ( artifact.isSnapshot() && repo.getSnapshots().isEnabled() ) )
@@ -340,7 +345,14 @@
                     catch ( RepositoryMetadataResolutionException e )
                     {
                         loggerManager.setThreshold( RepositoryMetadataManager.class.getName(),
oldThreshold );
-                        log.error( "Unable to connect to: " + repo.getUrl(), e );
+                        if ( log.isDebugEnabled() )
+                        {
+                            log.error( "Unable to connect to: " + repo.getUrl(), e );
+                        }
+                        else
+                        {
+                            log.error( "Unable to connect to: " + repo.getUrl() );
+                        }
                         return artifact.getFile().getName();
                     }
                     finally

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.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/DependenciesRenderer.java?rev=676745&r1=676744&r2=676745&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
Mon Jul 14 14:29:25 2008
@@ -824,7 +824,14 @@
                     if ( dependencyExists )
                     {
                         sink.tableCell();
-                        sink.link( depUrl );
+                        if ( StringUtils.isNotEmpty( depUrl ) )
+                        {
+                            sink.link( depUrl );
+                        }
+                        else
+                        {
+                            sink.text( depUrl );
+                        }
 
                         sink.figure();
                         sink.figureCaption();



Mime
View raw message