Author: hboutemy Date: Thu Sep 1 21:11:46 2011 New Revision: 1164275 URL: http://svn.apache.org/viewvc?rev=1164275&view=rev Log: improved documentation
Added: maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java (with props) Modified: maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/MavenMultiPageReport.java maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt Modified: maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java?rev=1164275&r1=1164274&r2=1164275&view=diff ============================================================================== --- maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java (original) +++ maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java Thu Sep 1 21:11:46 2011 @@ -198,7 +198,10 @@ public abstract class AbstractMavenRepor closeReport(); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + * @return CATEGORY_PROJECT_REPORTS + */ public String getCategoryName() { return CATEGORY_PROJECT_REPORTS; Modified: maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/MavenMultiPageReport.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/MavenMultiPageReport.java?rev=1164275&r1=1164274&r2=1164275&view=diff ============================================================================== --- maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/MavenMultiPageReport.java (original) +++ maven/shared/trunk/maven-reporting-impl/src/main/java/org/apache/maven/reporting/MavenMultiPageReport.java Thu Sep 1 21:11:46 2011 @@ -25,8 +25,8 @@ import org.apache.maven.doxia.sink.SinkF import java.util.Locale; /** - * Temporary copy of <code>maven-reporting-api</code> class to avoid - * Maven 3 prerequisite, since <code>maven-reporting-api</code> is included + * Temporary copy of <a href="http://maven.apache.org/shared/maven-reporting-api/"><code>maven-reporting-api</code></a> + * class to avoid Maven 3 prerequisite, since <code>maven-reporting-api</code> is included * in Maven 2 then internal version is preferred. */ public interface MavenMultiPageReport Modified: maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt?rev=1164275&r1=1164274&r2=1164275&view=diff ============================================================================== --- maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt (original) +++ maven/shared/trunk/maven-reporting-impl/src/site/apt/index.apt Thu Sep 1 21:11:46 2011 @@ -1,21 +1,43 @@ ----- - Maven Reporting Implementation + About ----- Hervé Boutemy ----- - 2010-05-09 + 2011-09-01 ----- Maven Reporting Implementation - Abstract classes to manage report generation. + Abstract classes to manage report generation, which can be run both: + + * as part of a site generation (as a {{{../maven-reporting-api/}maven-reporting-api}}'s + <<<{{{../maven-reporting-api/apidocs/org/apache/maven/reporting/MavenReport.html}MavenReport}}>>>), + + * or as a direct standalone invocation (as a {{{/ref/current/maven-plugin-api/}maven-plugin-api}}'s + <<<{{{/ref/current/maven-plugin-api/apidocs/org/apache/maven/plugin/Mojo.html}Mojo}})>>>. + + [] + +* Usage + + Creating a new report plugin can be done by copying + <<<{{{./xref-test/org/apache/maven/reporting/AbstractMavenReportTest.html}AbstractMavenReportTest.java}}>>> + structure and implement a few methods. + +* History + +** inclusion in Maven core Until Maven 2.0.4, <<<maven-reporting-impl>>> was included in Maven 2 core distribution: version - used was completely driven by Maven version used. It was removed from Maven core starting with Maven 2.0.5 and + used was completely driven by Maven version used. + + The module was removed from Maven core starting with Maven 2.0.5 and moved to shared components to improve fexibility: starting with Maven 2.0.5, each plugin can choose its <<<maven-reporting-impl>>> version independently from Maven. - <<<maven-reporting-impl 2.0.x>>> uses Doxia 1.0, then is used for reporting plugins wanting Maven 2.0.x compatibility. +** Doxia dependency + + <<<maven-reporting-impl 2.0.x>>> use Doxia 1.0, then is used for reporting plugins wanting Maven 2.0.x compatibility. - <<<maven-reporting-impl 2.1.x>>> uses Doxia 1.1: using this version implies for a reporting plugin that it has Maven 2.1 + <<<maven-reporting-impl 2.1.x>>> use Doxia 1.1: using this version implies for a reporting plugin that it has Maven 2.1 as prerequisite. Added: maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java?rev=1164275&view=auto ============================================================================== --- maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java (added) +++ maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java Thu Sep 1 21:11:46 2011 @@ -0,0 +1,104 @@ +package org.apache.maven.reporting; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 java.io.File; +import java.util.Locale; + +import org.apache.maven.doxia.siterenderer.Renderer; +import org.apache.maven.project.MavenProject; + +/** + * Typical code to copy as a reporting plugin start: choose the goal name, then implement getOutputName(), + * getName( Locale ), getDescription( Locale ) and of course executeReport( Locale ). + * + * @goal test + */ +public class AbstractMavenReportTest + extends AbstractMavenReport +{ + /** + * The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from + * the command line. If the goal is run indirectly as part of a site generation, the output directory configured in + * the Maven Site Plugin is used instead. + * + * @parameter expression="${project.reporting.outputDirectory}" + * @required + */ + protected File outputDirectory; + + /** + * The Maven Project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + protected MavenProject project; + + /** + * Doxia Site Renderer component. + * + * @component + */ + protected Renderer siteRenderer; + + @Override + protected String getOutputDirectory() + { + return outputDirectory.getAbsolutePath(); + } + + @Override + protected MavenProject getProject() + { + return project; + } + + @Override + protected Renderer getSiteRenderer() + { + return siteRenderer; + } + + public String getOutputName() + { + return "abstract-maven-report-test"; + } + + public String getName( Locale locale ) + { + return "Abstract Maven Report Test"; + } + + public String getDescription( Locale locale ) + { + return "Abstract Maven Report Test Description"; + } + + @Override + protected void executeReport( Locale locale ) + throws MavenReportException + { + getSink().body(); + getSink().text( "Abstract Maven Report Test Content" ); + getSink().body_(); + } +} Propchange: maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: maven/shared/trunk/maven-reporting-impl/src/test/java/org/apache/maven/reporting/AbstractMavenReportTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain