From 35eb0793a3b13a6e1214ca1423195d48de53e9a0 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Wed, 22 Jun 2005 23:01:35 +0000 Subject: [PATCH] git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@193024 13f79535-47bb-0310-9956-ffa450edef68 --- .../projectinfo/DependenciesReport.java | 400 +++++++++--------- .../projectinfo/MailingListsReport.java | 2 +- 2 files changed, 201 insertions(+), 201 deletions(-) diff --git a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java index ff20ef6385..0c007f9d49 100644 --- a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java +++ b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/DependenciesReport.java @@ -1,200 +1,200 @@ -package org.apache.maven.report.projectinfo; - -/* - * Copyright 2004-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.maven.model.Dependency; -import org.apache.maven.model.Model; -import org.apache.maven.project.MavenProject; -import org.apache.maven.reporting.AbstractMavenReportRenderer; -import org.apache.maven.reporting.AbstractMavenReport; -import org.apache.maven.reporting.MavenReportException; -import org.codehaus.doxia.sink.Sink; -import org.codehaus.doxia.site.renderer.SiteRenderer; - -import java.io.IOException; -import java.util.Iterator; -import java.util.Locale; -import java.util.ResourceBundle; - -/** - * @goal dependencies - * - * @author Jason van Zyl - * @version $Id: DependenciesReport.java,v 1.2 2005/02/23 00:08:02 brett Exp $ - * @plexus.component - */ -public class DependenciesReport - extends AbstractMavenReport -{ - /** - * @parameter expression="${project.build.directory}/site" - * @required - */ - private String outputDirectory; - - /** - * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}" - * @required - * @readonly - */ - private SiteRenderer siteRenderer; - - /** - * @parameter expression="${project}" - * @required - * @readonly - */ - private MavenProject project; - - /** - * @see org.apache.maven.reporting.MavenReport#getName(java.util.Locale) - */ - public String getName( Locale locale ) - { - return getBundle( locale ).getString( "report.dependencies.name" ); - } - - /** - * @see org.apache.maven.reporting.MavenReport#getCategoryName() - */ - public String getCategoryName() - { - return CATEGORY_PROJECT_INFORMATION; - } - - /** - * @see org.apache.maven.reporting.MavenReport#getDescription(java.util.Locale) - */ - public String getDescription( Locale locale ) - { - return getBundle( locale ).getString( "report.dependencies.description" ); - } - - /** - * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory() - */ - protected String getOutputDirectory() - { - return outputDirectory; - } - - /** - * @see org.apache.maven.reporting.AbstractMavenReport#getProject() - */ - protected MavenProject getProject() - { - return project; - } - - /** - * @see org.apache.maven.reporting.AbstractMavenReport#getSiteRenderer() - */ - protected SiteRenderer getSiteRenderer() - { - return siteRenderer; - } - - /** - * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale) - */ - public void executeReport( Locale locale ) - throws MavenReportException - { - try - { - DependenciesRenderer r = new DependenciesRenderer( getSink(), getProject().getModel(), locale ); - - r.render(); - } - catch( IOException e ) - { - throw new MavenReportException( "Can't write the report " + getOutputName(), e ); - } - } - - /** - * @see org.apache.maven.reporting.MavenReport#getOutputName() - */ - public String getOutputName() - { - return "dependencies"; - } - - static class DependenciesRenderer - extends AbstractMavenReportRenderer - { - private Model model; - - private Locale locale; - - public DependenciesRenderer( Sink sink, Model model, Locale locale ) - { - super( sink ); - - this.model = model; - - this.locale = locale; - } - - // How to i18n these ... - public String getTitle() - { - return getBundle( locale ).getString( "report.dependencies.title" ); - } - - public void renderBody() - { - startSection( getTitle() ); - - if ( model.getDependencies().isEmpty() ) - { - // TODO: should the report just be excluded? - paragraph( getBundle( locale ).getString( "report.dependencies.nolist" ) ); - } - else - { - startTable(); - - tableCaption( getBundle( locale ).getString( "report.dependencies.intro" ) ); - - String groupId = getBundle( locale ).getString( "report.dependencies.column.groupId" ); - - String artifactId = getBundle( locale ).getString( "report.dependencies.column.artifactId" ); - - String version = getBundle( locale ).getString( "report.dependencies.column.version" ); - - tableHeader( new String[]{groupId, artifactId, version} ); - - for ( Iterator i = model.getDependencies().iterator(); i.hasNext(); ) - { - Dependency d = (Dependency) i.next(); - - tableRow( new String[]{d.getGroupId(), d.getArtifactId(), d.getVersion()} ); - } - - endTable(); - } - - endSection(); - } - } - - private static ResourceBundle getBundle( Locale locale ) - { - return ResourceBundle.getBundle("project-info-report", locale, DependenciesReport.class.getClassLoader() ); - } -} +package org.apache.maven.report.projectinfo; + +/* + * Copyright 2004-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.model.Dependency; +import org.apache.maven.model.Model; +import org.apache.maven.project.MavenProject; +import org.apache.maven.reporting.AbstractMavenReportRenderer; +import org.apache.maven.reporting.AbstractMavenReport; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.doxia.sink.Sink; +import org.codehaus.doxia.site.renderer.SiteRenderer; + +import java.io.IOException; +import java.util.Iterator; +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * @goal dependencies + * + * @author Jason van Zyl + * @version $Id$ + * @plexus.component + */ +public class DependenciesReport + extends AbstractMavenReport +{ + /** + * @parameter expression="${project.build.directory}/site" + * @required + */ + private String outputDirectory; + + /** + * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}" + * @required + * @readonly + */ + private SiteRenderer siteRenderer; + + /** + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * @see org.apache.maven.reporting.MavenReport#getName(java.util.Locale) + */ + public String getName( Locale locale ) + { + return getBundle( locale ).getString( "report.dependencies.name" ); + } + + /** + * @see org.apache.maven.reporting.MavenReport#getCategoryName() + */ + public String getCategoryName() + { + return CATEGORY_PROJECT_INFORMATION; + } + + /** + * @see org.apache.maven.reporting.MavenReport#getDescription(java.util.Locale) + */ + public String getDescription( Locale locale ) + { + return getBundle( locale ).getString( "report.dependencies.description" ); + } + + /** + * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory() + */ + protected String getOutputDirectory() + { + return outputDirectory; + } + + /** + * @see org.apache.maven.reporting.AbstractMavenReport#getProject() + */ + protected MavenProject getProject() + { + return project; + } + + /** + * @see org.apache.maven.reporting.AbstractMavenReport#getSiteRenderer() + */ + protected SiteRenderer getSiteRenderer() + { + return siteRenderer; + } + + /** + * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale) + */ + public void executeReport( Locale locale ) + throws MavenReportException + { + try + { + DependenciesRenderer r = new DependenciesRenderer( getSink(), getProject().getModel(), locale ); + + r.render(); + } + catch( IOException e ) + { + throw new MavenReportException( "Can't write the report " + getOutputName(), e ); + } + } + + /** + * @see org.apache.maven.reporting.MavenReport#getOutputName() + */ + public String getOutputName() + { + return "dependencies"; + } + + static class DependenciesRenderer + extends AbstractMavenReportRenderer + { + private Model model; + + private Locale locale; + + public DependenciesRenderer( Sink sink, Model model, Locale locale ) + { + super( sink ); + + this.model = model; + + this.locale = locale; + } + + // How to i18n these ... + public String getTitle() + { + return getBundle( locale ).getString( "report.dependencies.title" ); + } + + public void renderBody() + { + startSection( getTitle() ); + + if ( model.getDependencies().isEmpty() ) + { + // TODO: should the report just be excluded? + paragraph( getBundle( locale ).getString( "report.dependencies.nolist" ) ); + } + else + { + startTable(); + + tableCaption( getBundle( locale ).getString( "report.dependencies.intro" ) ); + + String groupId = getBundle( locale ).getString( "report.dependencies.column.groupId" ); + + String artifactId = getBundle( locale ).getString( "report.dependencies.column.artifactId" ); + + String version = getBundle( locale ).getString( "report.dependencies.column.version" ); + + tableHeader( new String[]{groupId, artifactId, version} ); + + for ( Iterator i = model.getDependencies().iterator(); i.hasNext(); ) + { + Dependency d = (Dependency) i.next(); + + tableRow( new String[]{d.getGroupId(), d.getArtifactId(), d.getVersion()} ); + } + + endTable(); + } + + endSection(); + } + } + + private static ResourceBundle getBundle( Locale locale ) + { + return ResourceBundle.getBundle("project-info-report", locale, DependenciesReport.class.getClassLoader() ); + } +} diff --git a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java index c8812360f5..cbcc1fa9c1 100644 --- a/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java +++ b/maven-reports/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java @@ -35,7 +35,7 @@ import java.util.ResourceBundle; /** * @author Brett Porter * @author Vincent Siveton - * @version $Id: MailingListsReport.java,v 1.4 2005/02/23 00:08:03 brett Exp $ + * @version $Id$ * @goal mailing-list */ public class MailingListsReport