maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1152565 - /maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
Date Sun, 31 Jul 2011 11:50:41 GMT
Author: hboutemy
Date: Sun Jul 31 11:50:40 2011
New Revision: 1152565

URL: http://svn.apache.org/viewvc?rev=1152565&view=rev
Log:
[MPIR-227] added a license index in case of multiple licenses copied into the report
Submitted by: Robin Vobruba
Applied with minor code formatting fixes

Modified:
    maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java

Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java?rev=1152565&r1=1152564&r2=1152565&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
(original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/LicenseReport.java
Sun Jul 31 11:50:40 2011
@@ -21,6 +21,7 @@ package org.apache.maven.report.projecti
 
 import org.apache.commons.validator.UrlValidator;
 import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.util.HtmlTools;
 import org.apache.maven.model.License;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.settings.Settings;
@@ -256,6 +257,21 @@ public class LicenseReport
             // License
             startSection( getI18nString( "title" ) );
 
+            boolean renderIndex = ( ( licenses.size() > 1 ) && !linkOnly );
+            if ( renderIndex )
+            {
+                sink.rawText( "<ul>" );
+                for ( License license : licenses )
+                {
+                    String name = license.getName();
+
+                    sink.rawText( "<li>" );
+                    link( "#" + HtmlTools.encodeId( name ), name );
+                    sink.rawText( "</li>" );
+                }
+                sink.rawText( "</ul>" );
+            }
+
             for ( License license : licenses )
             {
                 String name = license.getName();



Mime
View raw message