maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1488566 - /maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
Date Sat, 01 Jun 2013 19:35:20 GMT
Author: hboutemy
Date: Sat Jun  1 19:35:19 2013
New Revision: 1488566

URL: http://svn.apache.org/r1488566
Log:
don't write http://maven.apache.org for each url, just relative path

Modified:
    maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java

Modified: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java?rev=1488566&r1=1488565&r2=1488566&view=diff
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
(original)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckSiteMojo.java
Sat Jun  1 19:35:19 2013
@@ -59,7 +59,7 @@ import org.jsoup.nodes.Element;
 @Mojo( name = "check-site" )
 public class DistCheckSiteMojo extends AbstractDistCheckMojo
 {
-// common type for site checker
+    private static final String MAVEN_SITE = "http://maven.apache.org";
 
     @Parameter( property = "localRepository", required = true, readonly = true )
     protected ArtifactRepository localRepository;
@@ -250,7 +250,7 @@ public class DistCheckSiteMojo extends A
                 sink.rawText( "[" + csr.getStatusCode() + "] " );
             }
             sink.link( csr.getUrl() );
-            sink.rawText( csr.getUrl() );
+            sink.rawText( getSimplifiedUrl( csr.getUrl() ) );
             sink.link_();
             sink.tableCell_();
 
@@ -287,6 +287,15 @@ public class DistCheckSiteMojo extends A
         sink.close();
     }
 
+    private String getSimplifiedUrl( String url )
+    {
+        if ( url.startsWith( MAVEN_SITE ) )
+        {
+            return url.substring( MAVEN_SITE.length() );
+        }
+        return url;
+    }
+
     private void checkSite( String repourl, ConfigurationLineInfo r, String version )
     {
         DistCheckSiteResult result = new DistCheckSiteResult( r, version );



Mime
View raw message