PR: MNG-856

Submitted by: Allan Ramirez
Reviewed by:  Brett Porter
site plugin documentation

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@290674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-21 10:20:21 +00:00
parent 3af4a18f48
commit 0f021ff7eb
2 changed files with 71 additions and 2 deletions

View File

@ -95,7 +95,7 @@ public class DoxiaMojo
"**/.DS_Store"}; "**/.DS_Store"};
/** /**
* Directory that contains the reports in apt/fml format. * Directory containing source for apt, fml and xdoc docs.
* *
* @parameter expression="${basedir}/src/site" * @parameter expression="${basedir}/src/site"
* @required * @required
@ -109,7 +109,7 @@ public class DoxiaMojo
private File generatedSiteDirectory; private File generatedSiteDirectory;
/** /**
* Directory that contains the generated reports. * Directory containing the generated project sites and report distributions.
* *
* @parameter expression="${project.build.directory}/site" * @parameter expression="${project.build.directory}/site"
* @required * @required
@ -164,6 +164,8 @@ public class DoxiaMojo
private String outputEncoding; private String outputEncoding;
/** /**
* Site Renderer
*
* @parameter expression="${component.org.codehaus.plexus.siterenderer.Renderer}" * @parameter expression="${component.org.codehaus.plexus.siterenderer.Renderer}"
* @required * @required
* @readonly * @readonly
@ -196,6 +198,10 @@ public class DoxiaMojo
private List reports; private List reports;
/** /**
* Generate the project site
*
* throws MojoExecutionException if any
*
* @see org.apache.maven.plugin.Mojo#execute() * @see org.apache.maven.plugin.Mojo#execute()
*/ */
public void execute() public void execute()
@ -502,6 +508,14 @@ public class DoxiaMojo
return localesList; return localesList;
} }
/**
* Retrieve the reports menu
*
* @param locale the locale used
* @param projectInfos list of project infos
* @param projectReports list of project reports
* @return a XML for reports menu
*/
private String getReportsMenu( Locale locale, List projectInfos, List projectReports ) private String getReportsMenu( Locale locale, List projectInfos, List projectReports )
{ {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
@ -522,6 +536,15 @@ public class DoxiaMojo
return buffer.toString(); return buffer.toString();
} }
/**
* Create a report sub menu
*
* @param reports list of reports specified in pom
* @param buffer string to be appended
* @param locale the locale used
* @param key
* @param indexFilename index page filename
*/
private void writeReportSubMenu( List reports, StringBuffer buffer, Locale locale, String key, private void writeReportSubMenu( List reports, StringBuffer buffer, Locale locale, String key,
String indexFilename ) String indexFilename )
{ {
@ -798,6 +821,14 @@ public class DoxiaMojo
return generatedReportsFileName; return generatedReportsFileName;
} }
/**
* Generates Project Info Page
*
* @param siteDescriptor site.xml
* @param locale the locale used
* @param projectInfos list of projectInfos
* @param outputDirectory directory that will contain the generated project info page
*/
private void generateProjectInfoPage( String siteDescriptor, Locale locale, List projectInfos, private void generateProjectInfoPage( String siteDescriptor, Locale locale, List projectInfos,
File outputDirectory ) File outputDirectory )
throws RendererException, IOException throws RendererException, IOException
@ -879,6 +910,14 @@ public class DoxiaMojo
template, attributes, sink, locale ); template, attributes, sink, locale );
} }
/**
* Generates the Project Report Pages
*
* @param siteDescriptor site.xml
* @param locale the locale used
* @param projectReports list of project reports
* @param outputDirectory directory that will contain the generated project report pages
*/
private void generateProjectReportsPage( String siteDescriptor, Locale locale, List projectReports, private void generateProjectReportsPage( String siteDescriptor, Locale locale, List projectReports,
File outputDirectory ) File outputDirectory )
throws RendererException, IOException throws RendererException, IOException
@ -956,6 +995,12 @@ public class DoxiaMojo
template, attributes, sink, locale ); template, attributes, sink, locale );
} }
/**
* Copy Resources
*
* @param outputDir the output directory
* @throws IOException if any
*/
private void copyResources( File outputDir ) private void copyResources( File outputDir )
throws IOException throws IOException
{ {
@ -997,11 +1042,24 @@ public class DoxiaMojo
} }
} }
/**
* Get the resource as stream
*
* @param name
* @return the inputstream
*/
private InputStream getStream( String name ) private InputStream getStream( String name )
{ {
return DoxiaMojo.class.getClassLoader().getResourceAsStream( name ); return DoxiaMojo.class.getClassLoader().getResourceAsStream( name );
} }
/**
* Copy the directory
*
* @param source source file to be copied
* @param destination destination file
* @throws IOException if any
*/
private void copyDirectory( File source, File destination ) private void copyDirectory( File source, File destination )
throws IOException throws IOException
{ {

View File

@ -6,6 +6,17 @@ Maven 2 Site Plugin
Generate the project's site and report distributions. Generate the project's site and report distributions.
*How to Use Site plugin
Here is a link for more information {{{http://maven.apache.org/maven2/site.html}http://maven.apache.org/maven2/site.html}}
------
Maven 2 Site Plugin
------
Maven 2 Site Plugin
Generate the project's site and report distributions.
*How to Use *How to Use
Using the site plugin is very easy, just execute the site goal from your project Using the site plugin is very easy, just execute the site goal from your project