You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/01/27 14:21:34 UTC
svn commit: r615593 - in /maven/shared/trunk/maven-doxia-tools: ./
src/main/java/org/apache/maven/doxia/tools/ src/main/resources/
src/test/java/org/apache/maven/doxia/tools/
src/test/java/org/apache/maven/doxia/tools/stubs/
Author: vsiveton
Date: Sun Jan 27 05:21:32 2008
New Revision: 615593
URL: http://svn.apache.org/viewvc?rev=615593&view=rev
Log:
MSITE-290: Move logic from AbstractSiteMojo and AbstractSiteRenderingMojo for Doxia related stuff
o moved from o.a.m.p.site:
- AbstractSiteMojo#populateModules( DecorationModel decorationModel, Locale locale, boolean keepInheritedRefs )
- AbstractSiteMojo#populateModulesMenuItemsFromReactorProjects( Menu menu )
- AbstractSiteMojo#populateModulesMenuItemsFromModels( List models, Menu menu )
- AbstractSiteMojo#appendMenuItem( Menu menu, String name, String href, String defaultHref )
- AbstractSiteMojo#populateReportsMenu( DecorationModel decorationModel, Locale locale, Map categories )
- AbstractSiteMojo#createCategoryMenu( String name, String href, List categoryReports, Locale locale )
- AbstractSiteMojo#isEmptyList( List list )
- AbstractSiteMojo#populateProjectParentMenu( DecorationModel decorationModel, Locale locale, MavenProject parentProject, boolean keepInheritedRefs )
- AbstractSiteMojo#getParentProject( MavenProject aProject )
- AbstractSiteMojo#getInterpolatedSiteDescriptorContent( Map props, MavenProject aProject, String siteDescriptorContent )
- AbstractSiteRenderingMojo#getDecorationModel( MavenProject project, Locale locale, Map origProps )
- AbstractSiteRenderingMojo#readDecorationModel( String siteDescriptorContent )
- AbstractSiteRenderingMojo#getDecorationModel( Locale locale )
- ReportComparator.java
- default-site.xml
- some keys in bundles
o added more test cases
o updated javadoc
Added:
maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/ReportComparator.java
- copied, changed from r614369, maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/ReportComparator.java
maven/shared/trunk/maven-doxia-tools/src/main/resources/
maven/shared/trunk/maven-doxia-tools/src/main/resources/default-site.xml
- copied unchanged from r614369, maven/plugins/trunk/maven-site-plugin/src/main/resources/default-site.xml
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties (with props)
maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties (with props)
Modified:
maven/shared/trunk/maven-doxia-tools/pom.xml
maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/stubs/SiteToolMavenProjectStub.java
Modified: maven/shared/trunk/maven-doxia-tools/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/pom.xml?rev=615593&r1=615592&r2=615593&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/pom.xml (original)
+++ maven/shared/trunk/maven-doxia-tools/pom.xml Sun Jan 27 05:21:32 2008
@@ -77,6 +77,16 @@
<artifactId>maven-model</artifactId>
<version>2.0.2</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-api</artifactId>
+ <version>2.0.4</version>
+ </dependency>
<!-- doxia-sitetools -->
<dependency>
@@ -95,6 +105,17 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0-alpha-9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-i18n</artifactId>
+ <version>1.0-beta-7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Modified: maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java?rev=615593&r1=615592&r2=615593&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java (original)
+++ maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java Sun Jan 27 05:21:32 2008
@@ -21,10 +21,17 @@
import java.io.File;
import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.StringTokenizer;
import org.apache.maven.artifact.Artifact;
@@ -35,12 +42,32 @@
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.doxia.site.decoration.Banner;
import org.apache.maven.doxia.site.decoration.DecorationModel;
+import org.apache.maven.doxia.site.decoration.Menu;
+import org.apache.maven.doxia.site.decoration.MenuItem;
import org.apache.maven.doxia.site.decoration.Skin;
+import org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler;
+import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader;
+import org.apache.maven.model.Model;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.reporting.MavenReport;
+import org.codehaus.plexus.i18n.I18N;
import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.interpolation.EnvarBasedValueSource;
+import org.codehaus.plexus.util.interpolation.MapBasedValueSource;
+import org.codehaus.plexus.util.interpolation.ObjectBasedValueSource;
+import org.codehaus.plexus.util.interpolation.RegexBasedInterpolator;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
+ * Default implementation of the site tool.
+ *
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
*
@@ -68,6 +95,27 @@
*/
private ArtifactFactory artifactFactory;
+ /**
+ * Internationalization.
+ *
+ * @plexus.requirement
+ */
+ protected I18N i18n;
+
+ /**
+ * The component for assembling inheritance.
+ *
+ * @plexus.requirement
+ */
+ protected DecorationModelInheritanceAssembler assembler;
+
+ /**
+ * Project builder.
+ *
+ * @plexus.requirement
+ */
+ protected MavenProjectBuilder mavenProjectBuilder;
+
// ----------------------------------------------------------------------
// Public methods
// ----------------------------------------------------------------------
@@ -352,6 +400,7 @@
if ( siteDirectory == null )
{
+ // TODO need to be more dynamic
siteDirectory = new File( basedir, "src/site" );
}
if ( locale == null )
@@ -371,7 +420,8 @@
}
/** {@inheritDoc} */
- public File getSiteDescriptorFromRepository( MavenProject project, ArtifactRepository localRepository, List remoteArtifactRepositories, Locale locale )
+ public File getSiteDescriptorFromRepository( MavenProject project, ArtifactRepository localRepository,
+ List remoteArtifactRepositories, Locale locale )
throws SiteToolException
{
if ( project == null )
@@ -403,7 +453,8 @@
}
catch ( ArtifactResolutionException e )
{
- throw new SiteToolException( "ArtifactResolutionException: Unable to locate site descriptor: " + e.getMessage() );
+ throw new SiteToolException( "ArtifactResolutionException: Unable to locate site descriptor: "
+ + e.getMessage() );
}
catch ( IOException e )
{
@@ -411,11 +462,460 @@
}
}
+ /** {@inheritDoc} */
+ public DecorationModel getDecorationModel( MavenProject project, List reactorProjects,
+ ArtifactRepository localRepository, List repositories,
+ File siteDirectory, Locale locale, String inputEncoding,
+ String outputEncoding )
+ throws SiteToolException
+ {
+ if ( project == null )
+ {
+ throw new IllegalArgumentException( "project could not be null" );
+ }
+ if ( reactorProjects == null )
+ {
+ throw new IllegalArgumentException( "reactorProjects could not be null" );
+ }
+ if ( localRepository == null )
+ {
+ throw new IllegalArgumentException( "localRepository could not be null" );
+ }
+ if ( repositories == null )
+ {
+ throw new IllegalArgumentException( "repositories could not be null" );
+ }
+ if ( inputEncoding == null )
+ {
+ throw new IllegalArgumentException( "inputEncoding could not be null" );
+ }
+ if ( outputEncoding == null )
+ {
+ throw new IllegalArgumentException( "outputEncoding could not be null" );
+ }
+
+ if ( siteDirectory == null )
+ {
+ // TODO need to be more dynamic
+ siteDirectory = new File( project.getBasedir(), "src/site" );
+ }
+ if ( locale == null )
+ {
+ locale = Locale.getDefault();
+ }
+
+ Map props = new HashMap();
+
+ // This is to support the deprecated ${reports} and ${modules} tags.
+ props.put( "reports", "<menu ref=\"reports\"/>\n" );
+ props.put( "modules", "<menu ref=\"modules\"/>\n" );
+
+ DecorationModel decorationModel = getDecorationModel( project, reactorProjects, localRepository, repositories,
+ siteDirectory, locale, props, inputEncoding,
+ outputEncoding );
+
+ if ( decorationModel == null )
+ {
+ String siteDescriptorContent;
+
+ try
+ {
+ // Note the default is not a super class - it is used when nothing else is found
+ siteDescriptorContent = IOUtil.toString( getClass().getResourceAsStream( "/default-site.xml" ) );
+ }
+ catch ( IOException e )
+ {
+ throw new SiteToolException( "Error reading default site descriptor: " + e.getMessage(), e );
+ }
+
+ siteDescriptorContent = getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent,
+ inputEncoding, outputEncoding );
+
+ decorationModel = readDecorationModel( siteDescriptorContent );
+ }
+ populateModules( project, reactorProjects, localRepository, decorationModel, locale, true );
+
+ if ( decorationModel.getBannerLeft() == null )
+ {
+ // extra default to set
+ Banner banner = new Banner();
+ banner.setName( project.getName() );
+ decorationModel.setBannerLeft( banner );
+ }
+
+ if ( project.getUrl() != null )
+ {
+ assembler.resolvePaths( decorationModel, project.getUrl() );
+ }
+ else
+ {
+ getLogger().warn( "No URL defined for the project - decoration links will not be resolved" );
+ }
+
+ return decorationModel;
+ }
+
+ /** {@inheritDoc} */
+ public void populateReportsMenu( DecorationModel decorationModel, Locale locale, Map categories )
+ {
+ if ( decorationModel == null )
+ {
+ throw new IllegalArgumentException( "decorationModel could not be null" );
+ }
+ if ( categories == null )
+ {
+ throw new IllegalArgumentException( "categories could not be null" );
+ }
+
+ if ( locale == null )
+ {
+ locale = Locale.getDefault();
+ }
+
+ Menu menu = decorationModel.getMenuRef( "reports" );
+
+ if ( menu != null )
+ {
+ if ( menu.getName() == null )
+ {
+ menu.setName( i18n.getString( "site-tool", locale, "decorationModel.menu.projectdocumentation" ) );
+ }
+
+ boolean found = false;
+ if ( menu.getItems().isEmpty() )
+ {
+ List categoryReports = (List) categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );
+ if ( !isEmptyList( categoryReports ) )
+ {
+ MenuItem item = createCategoryMenu( i18n.getString( "site-tool", locale,
+ "decorationModel.menu.projectinformation" ),
+ "/project-info.html", categoryReports, locale );
+ menu.getItems().add( item );
+ found = true;
+ }
+
+ categoryReports = (List) categories.get( MavenReport.CATEGORY_PROJECT_REPORTS );
+ if ( !isEmptyList( categoryReports ) )
+ {
+ MenuItem item = createCategoryMenu( i18n.getString( "site-tool", locale,
+ "decorationModel.menu.projectreports" ),
+ "/project-reports.html", categoryReports, locale );
+ menu.getItems().add( item );
+ found = true;
+ }
+ }
+ if ( !found )
+ {
+ decorationModel.removeMenuRef( "reports" );
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ public String getInterpolatedSiteDescriptorContent( Map props, MavenProject aProject, String siteDescriptorContent,
+ String inputEncoding, String outputEncoding )
+ throws SiteToolException
+ {
+ if ( props == null )
+ {
+ throw new IllegalArgumentException( "props could not be null" );
+ }
+ if ( aProject == null )
+ {
+ throw new IllegalArgumentException( "aProject could not be null" );
+ }
+ if ( siteDescriptorContent == null )
+ {
+ throw new IllegalArgumentException( "siteDescriptorContent could not be null" );
+ }
+ if ( inputEncoding == null )
+ {
+ throw new IllegalArgumentException( "inputEncoding could not be null" );
+ }
+ if ( outputEncoding == null )
+ {
+ throw new IllegalArgumentException( "outputEncoding could not be null" );
+ }
+
+ // MSITE-201: The ObjectBasedValueSource( aProject ) below will match
+ // ${modules} to aProject.getModules(), so we need to interpolate that
+ // first.
+
+ Map modulesProps = new HashMap();
+
+ // Legacy for the old ${modules} syntax
+ modulesProps.put( "modules", "<menu ref=\"modules\"/>" );
+
+ siteDescriptorContent = StringUtils.interpolate( siteDescriptorContent, modulesProps );
+
+ RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
+
+ try
+ {
+ interpolator.addValueSource( new EnvarBasedValueSource() );
+ }
+ catch ( IOException e )
+ {
+ // Prefer logging?
+ throw new SiteToolException( "IOException: cannot interpolate environment properties: " + e.getMessage(), e );
+ }
+
+ interpolator.addValueSource( new ObjectBasedValueSource( aProject ) );
+
+ interpolator.addValueSource( new MapBasedValueSource( aProject.getProperties() ) );
+
+ siteDescriptorContent = interpolator.interpolate( siteDescriptorContent, "project" );
+
+ props.put( "inputEncoding", inputEncoding );
+
+ props.put( "outputEncoding", outputEncoding );
+
+ // Legacy for the old ${parentProject} syntax
+ props.put( "parentProject", "<menu ref=\"parent\"/>" );
+
+ // Legacy for the old ${reports} syntax
+ props.put( "reports", "<menu ref=\"reports\"/>" );
+
+ return StringUtils.interpolate( siteDescriptorContent, props );
+ }
+
+ /** {@inheritDoc} */
+ public MavenProject getParentProject( MavenProject aProject, List reactorProjects,
+ ArtifactRepository localRepository )
+ {
+ if ( aProject == null )
+ {
+ throw new IllegalArgumentException( "aProject could not be null" );
+ }
+ if ( reactorProjects == null )
+ {
+ throw new IllegalArgumentException( "reactorProjects could not be null" );
+ }
+ if ( localRepository == null )
+ {
+ throw new IllegalArgumentException( "localRepository could not be null" );
+ }
+
+ MavenProject parentProject = null;
+
+ MavenProject origParent = aProject.getParent();
+ if ( origParent != null )
+ {
+ Iterator reactorItr = reactorProjects.iterator();
+
+ while ( reactorItr.hasNext() )
+ {
+ MavenProject reactorProject = (MavenProject) reactorItr.next();
+
+ if ( reactorProject.getGroupId().equals( origParent.getGroupId() )
+ && reactorProject.getArtifactId().equals( origParent.getArtifactId() )
+ && reactorProject.getVersion().equals( origParent.getVersion() ) )
+ {
+ parentProject = reactorProject;
+ break;
+ }
+ }
+
+ if ( parentProject == null && aProject.getBasedir() != null )
+ {
+ try
+ {
+ MavenProject mavenProject = mavenProjectBuilder.build( new File( aProject.getBasedir(), aProject
+ .getModel().getParent().getRelativePath() ), localRepository, null );
+ if ( mavenProject.getGroupId().equals( origParent.getGroupId() )
+ && mavenProject.getArtifactId().equals( origParent.getArtifactId() )
+ && mavenProject.getVersion().equals( origParent.getVersion() ) )
+ {
+ parentProject = mavenProject;
+ }
+ }
+ catch ( ProjectBuildingException e )
+ {
+ getLogger().info( "Unable to load parent project from a relative path: " + e.getMessage() );
+ }
+ }
+
+ if ( parentProject == null )
+ {
+ try
+ {
+ parentProject = mavenProjectBuilder.buildFromRepository( aProject.getParentArtifact(), aProject
+ .getRemoteArtifactRepositories(), localRepository );
+ getLogger().info( "Parent project loaded from repository." );
+ }
+ catch ( ProjectBuildingException e )
+ {
+ getLogger().warn( "Unable to load parent project from repository: " + e.getMessage() );
+ }
+ }
+
+ if ( parentProject == null )
+ {
+ // fallback to uninterpolated value
+
+ parentProject = origParent;
+ }
+ }
+ return parentProject;
+ }
+
+ /** {@inheritDoc} */
+ public void populateProjectParentMenu( DecorationModel decorationModel, Locale locale, MavenProject project,
+ MavenProject parentProject, boolean keepInheritedRefs )
+ {
+ if ( decorationModel == null )
+ {
+ throw new IllegalArgumentException( "decorationModel could not be null" );
+ }
+ if ( project == null )
+ {
+ throw new IllegalArgumentException( "project could not be null" );
+ }
+ if ( parentProject == null )
+ {
+ throw new IllegalArgumentException( "parentProject could not be null" );
+ }
+
+ if ( locale == null )
+ {
+ locale = Locale.getDefault();
+ }
+
+ Menu menu = decorationModel.getMenuRef( "parent" );
+
+ if ( menu != null )
+ {
+ if ( !keepInheritedRefs || !menu.isInheritAsRef() )
+ {
+ String parentUrl = parentProject.getUrl();
+
+ if ( parentUrl != null )
+ {
+ if ( parentUrl.endsWith( "/" ) )
+ {
+ parentUrl += "index.html";
+ }
+ else
+ {
+ parentUrl += "/index.html";
+ }
+
+ parentUrl = getRelativePath( parentUrl, project.getUrl() );
+
+ if ( menu.getName() == null )
+ {
+ menu.setName( i18n.getString( "site-tool", locale, "decorationModel.menu.parentproject" ) );
+ }
+
+ MenuItem item = new MenuItem();
+ item.setName( parentProject.getName() );
+ item.setHref( parentUrl );
+ menu.addItem( item );
+ }
+ else
+ {
+ decorationModel.removeMenuRef( "parent" );
+ }
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void populateModules( MavenProject project, List reactorProjects, ArtifactRepository localRepository,
+ DecorationModel decorationModel, Locale locale, boolean keepInheritedRefs )
+ throws SiteToolException
+ {
+ if ( project == null )
+ {
+ throw new IllegalArgumentException( "project could not be null" );
+ }
+ if ( reactorProjects == null )
+ {
+ throw new IllegalArgumentException( "reactorProjects could not be null" );
+ }
+ if ( localRepository == null )
+ {
+ throw new IllegalArgumentException( "localRepository could not be null" );
+ }
+ if ( decorationModel == null )
+ {
+ throw new IllegalArgumentException( "decorationModel could not be null" );
+ }
+
+ if ( locale == null )
+ {
+ locale = Locale.getDefault();
+ }
+
+ Menu menu = decorationModel.getMenuRef( "modules" );
+
+ if ( menu != null )
+ {
+ if ( !keepInheritedRefs || !menu.isInheritAsRef() )
+ {
+ // we require child modules and reactors to process module menu
+ if ( project.getModules().size() > 0 )
+ {
+ List projects = reactorProjects;
+
+ if ( menu.getName() == null )
+ {
+ menu.setName( i18n.getString( "site-tool", locale, "decorationModel.menu.projectmodules" ) );
+ }
+
+ if ( projects.size() == 1 )
+ {
+ getLogger().debug( "Attempting to source module information from local filesystem" );
+
+ // Not running reactor - search for the projects manually
+ List models = new ArrayList( project.getModules().size() );
+ for ( Iterator i = project.getModules().iterator(); i.hasNext(); )
+ {
+ String module = (String) i.next();
+ Model model;
+ File f = new File( project.getBasedir(), module + "/pom.xml" );
+ if ( f.exists() )
+ {
+ try
+ {
+ model = mavenProjectBuilder.build( f, localRepository, null ).getModel();
+ }
+ catch ( ProjectBuildingException e )
+ {
+ throw new SiteToolException( "Unable to read local module-POM", e );
+ }
+ }
+ else
+ {
+ getLogger().warn( "No filesystem module-POM available" );
+
+ model = new Model();
+ model.setName( module );
+ model.setUrl( module );
+ }
+ models.add( model );
+ }
+ populateModulesMenuItemsFromModels( project, models, menu );
+ }
+ else
+ {
+ populateModulesMenuItemsFromReactorProjects( project, reactorProjects, menu );
+ }
+ }
+ else
+ {
+ decorationModel.removeMenuRef( "modules" );
+ }
+ }
+ }
+ }
+
// ----------------------------------------------------------------------
// Private methods
// ----------------------------------------------------------------------
- private File resolveSiteDescriptor( MavenProject project, ArtifactRepository localRepository, List repositories, Locale locale )
+ private File resolveSiteDescriptor( MavenProject project, ArtifactRepository localRepository, List repositories,
+ Locale locale )
throws IOException, ArtifactResolutionException, ArtifactNotFoundException
{
File result;
@@ -483,5 +983,207 @@
}
return result;
+ }
+
+ private DecorationModel getDecorationModel( MavenProject project, List reactorProjects,
+ ArtifactRepository localRepository, List repositories,
+ File siteDirectory, Locale locale, Map origProps, String inputEncoding,
+ String outputEncoding )
+ throws SiteToolException
+ {
+ Map props = new HashMap( origProps );
+
+ File siteDescriptor;
+ if ( project.getBasedir() == null )
+ {
+ // POM is in the repository, look there for site descriptor
+ try
+ {
+ siteDescriptor = getSiteDescriptorFromRepository( project, localRepository, repositories, locale );
+ }
+ catch ( SiteToolException e )
+ {
+ throw new SiteToolException( "The site descriptor cannot be resolved from the repository: "
+ + e.getMessage(), e );
+ }
+ }
+ else
+ {
+ siteDescriptor = getSiteDescriptorFromBasedir( siteDirectory, project.getBasedir(), locale );
+ }
+
+ String siteDescriptorContent = null;
+ try
+ {
+ if ( siteDescriptor != null && siteDescriptor.exists() )
+ {
+ getLogger().debug( "Reading site descriptor from " + siteDescriptor );
+ Reader siteDescriptorReader = ReaderFactory.newXmlReader( siteDescriptor );
+ siteDescriptorContent = IOUtil.toString( siteDescriptorReader );
+ }
+ }
+ catch ( IOException e )
+ {
+ throw new SiteToolException( "The site descriptor cannot be read!", e );
+ }
+
+ DecorationModel decoration = null;
+ if ( siteDescriptorContent != null )
+ {
+ siteDescriptorContent = getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent,
+ inputEncoding, outputEncoding );
+
+ decoration = readDecorationModel( siteDescriptorContent );
+ }
+
+ MavenProject parentProject = getParentProject( project, reactorProjects, localRepository );
+ if ( parentProject != null )
+ {
+ getLogger().debug( "Parent project loaded ..." );
+ DecorationModel parent = getDecorationModel( parentProject, reactorProjects, localRepository, repositories,
+ siteDirectory, locale, props, inputEncoding, outputEncoding );
+
+ if ( decoration == null )
+ {
+ decoration = parent;
+ }
+ else
+ {
+ assembler.assembleModelInheritance( project.getName(), decoration, parent, project.getUrl(),
+ parentProject.getUrl() == null ? project.getUrl() : parentProject
+ .getUrl() );
+ }
+ if ( decoration != null )
+ {
+ populateProjectParentMenu( decoration, locale, project, parentProject, true );
+ }
+ }
+ if ( decoration != null && decoration.getSkin() != null )
+ {
+ getLogger().debug( "Skin used: " + decoration.getSkin() );
+ }
+
+ return decoration;
+ }
+
+ private DecorationModel readDecorationModel( String siteDescriptorContent )
+ throws SiteToolException
+ {
+ DecorationModel decoration;
+ try
+ {
+ decoration = new DecorationXpp3Reader().read( new StringReader( siteDescriptorContent ) );
+ }
+ catch ( XmlPullParserException e )
+ {
+ throw new SiteToolException( "Error parsing site descriptor", e );
+ }
+ catch ( IOException e )
+ {
+ throw new SiteToolException( "Error reading site descriptor", e );
+ }
+ return decoration;
+ }
+
+ private void populateModulesMenuItemsFromReactorProjects( MavenProject project, List reactorProjects, Menu menu )
+ {
+ if ( reactorProjects != null && reactorProjects.size() > 1 )
+ {
+ Iterator reactorItr = reactorProjects.iterator();
+
+ while ( reactorItr.hasNext() )
+ {
+ MavenProject reactorProject = (MavenProject) reactorItr.next();
+
+ if ( reactorProject != null && reactorProject.getParent() != null
+ && project.getArtifactId().equals( reactorProject.getParent().getArtifactId() ) )
+ {
+ String reactorUrl = reactorProject.getUrl();
+ String name = reactorProject.getName();
+
+ appendMenuItem( project, menu, name, reactorUrl, reactorProject.getArtifactId() );
+ }
+ }
+ }
+ }
+
+ private void populateModulesMenuItemsFromModels( MavenProject project, List models, Menu menu )
+ {
+ if ( models != null && models.size() > 1 )
+ {
+ Iterator reactorItr = models.iterator();
+
+ while ( reactorItr.hasNext() )
+ {
+ Model model = (Model) reactorItr.next();
+
+ String reactorUrl = model.getUrl();
+ String name = model.getName();
+
+ appendMenuItem( project, menu, name, reactorUrl, model.getArtifactId() );
+ }
+ }
+ }
+
+ private void appendMenuItem( MavenProject project, Menu menu, String name, String href, String defaultHref )
+ {
+ String selectedHref = href;
+
+ if ( selectedHref == null )
+ {
+ selectedHref = defaultHref;
+ }
+
+ MenuItem item = new MenuItem();
+ item.setName( name );
+
+ String baseUrl = project.getUrl();
+ if ( baseUrl != null )
+ {
+ selectedHref = getRelativePath( selectedHref, baseUrl );
+ }
+
+ if ( selectedHref.endsWith( "/" ) )
+ {
+ item.setHref( selectedHref + "index.html" );
+ }
+ else
+ {
+ item.setHref( selectedHref + "/index.html" );
+ }
+ menu.addItem( item );
+ }
+
+ private MenuItem createCategoryMenu( String name, String href, List categoryReports, Locale locale )
+ {
+ MenuItem item = new MenuItem();
+ item.setName( name );
+ item.setCollapse( true );
+ item.setHref( href );
+
+ Collections.sort( categoryReports, new ReportComparator( locale ) );
+
+ for ( Iterator k = categoryReports.iterator(); k.hasNext(); )
+ {
+ MavenReport report = (MavenReport) k.next();
+
+ MenuItem subitem = new MenuItem();
+ subitem.setName( report.getName( locale ) );
+ subitem.setHref( report.getOutputName() + ".html" );
+ item.getItems().add( subitem );
+ }
+
+ return item;
+ }
+
+ /**
+ * Convenience method.
+ *
+ * @param list
+ * @return true if the list is <code>null</code> or <code>null</code>
+ */
+ private static boolean isEmptyList( List list )
+ {
+ return list == null || list.isEmpty();
}
}
Copied: maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/ReportComparator.java (from r614369, maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/ReportComparator.java)
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/ReportComparator.java?p2=maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/ReportComparator.java&p1=maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/ReportComparator.java&r1=614369&r2=615593&rev=615593&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/ReportComparator.java (original)
+++ maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/ReportComparator.java Sun Jan 27 05:21:32 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.plugins.site;
+package org.apache.maven.doxia.tools;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -43,6 +43,7 @@
this.locale = locale;
}
+ /** {@inheritDoc} */
public int compare( Object o1, Object o2 )
{
MavenReport r1 = (MavenReport) o1;
Modified: maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java?rev=615593&r1=615592&r2=615593&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java (original)
+++ maven/shared/trunk/maven-doxia-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java Sun Jan 27 05:21:32 2008
@@ -22,6 +22,7 @@
import java.io.File;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -30,7 +31,8 @@
import org.apache.maven.project.MavenProject;
/**
- * This tool contains some utilities methods to play with Doxia <code>DecorationModel</code>.
+ * Tool to play with <a href="http://maven.apache.org/doxia/">Doxia</a> objects
+ * like <code>DecorationModel</code>.
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
@@ -41,9 +43,9 @@
String ROLE = SiteTool.class.getName();
/**
- * @param localRepository not null
- * @param remoteArtifactRepositories not null
- * @param decoration not null
+ * @param localRepository the Maven local repository, not null.
+ * @param remoteArtifactRepositories the Maven remote repositories, not null.
+ * @param decoration the Doxia site descriptor model, not null.
* @return the <code>Skin</code> artifact defined in a <code>DecorationModel</code> from a given project and a local repository
* @throws SiteToolException if any
*/
@@ -52,12 +54,13 @@
throws SiteToolException;
/**
- * @param localRepository not null
- * @param remoteArtifactRepositories not null
- * @param decoration not null
+ * @param localRepository the Maven local repository, not null.
+ * @param remoteArtifactRepositories the Maven remote repositories, not null.
+ * @param decoration the Doxia site descriptor model, not null.
* @return the default <code>Skin</code> artifact from a given project and a local repository
* @throws SiteToolException if any
* @see Skin#getDefaultSkin()
+ * @see #getSkinArtifactFromRepository(ArtifactRepository, List, DecorationModel)
*/
Artifact getDefaultSkinArtifact( ArtifactRepository localRepository, List remoteArtifactRepositories )
throws SiteToolException;
@@ -83,20 +86,122 @@
/**
* @param siteDirectory containing the <code>site.xml</code> file. If null, using by default "${basedir}/src/site".
* @param basedir not null.
- * @param locale the locale wanted for the site descriptor. If not null, searching for <code>site_<i>localeLanguage</i>.xml</code>
+ * @param locale the locale wanted for the site descriptor. If not null, searching for <code>site_<i>localeLanguage</i>.xml</code>,
+ * otherwise searching for <code>site.xml</code>.
* @return the site descriptor relative file, i.e. <code>src/site/site.xml</code>, depending parameters value.
*/
File getSiteDescriptorFromBasedir( File siteDirectory, File basedir, Locale locale );
/**
- * @param project Maven project not null
- * @param localRepository not null
- * @param repositories not null
- * @param locale the locale wanted for the site descriptor. If not null, searching for <code>site_<i>localeLanguage</i>.xml</code>
+ * @param project the Maven project, not null.
+ * @param localRepository the Maven local repository, not null.
+ * @param repositories the Maven remote repositories, not null.
+ * @param locale the locale wanted for the site descriptor. If not null, searching for <code>site_<i>localeLanguage</i>.xml</code>,
+ * otherwise searching for <code>site.xml</code>.
* @return the site descriptor into the local repository after download of it from repositories or null if not found in repositories.
* @throws SiteToolException if any
*/
- File getSiteDescriptorFromRepository( MavenProject project, ArtifactRepository localRepository,
- List repositories, Locale locale )
+ File getSiteDescriptorFromRepository( MavenProject project, ArtifactRepository localRepository, List repositories,
+ Locale locale )
+ throws SiteToolException;
+
+ /**
+ * @param project the Maven project, not null.
+ * @param reactorProjects the Maven reactor projects, not null.
+ * @param localRepository the Maven local repository, not null.
+ * @param repositories the Maven remote repositories, not null.
+ * @param siteDirectory containing the <code>site.xml</code> file. If null, using by default "${basedir}/src/site".
+ * @param locale the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
+ * @param inputEncoding the input encoding of the site descriptor, not null.
+ * @param outputEncoding the output encoding wanted, not null.
+ * @return the <code>DecorationModel</code> object corresponding to the <code>site.xml</code> file with some interpolations.
+ * @throws SiteToolException if any
+ */
+ DecorationModel getDecorationModel( MavenProject project, List reactorProjects, ArtifactRepository localRepository,
+ List repositories, File siteDirectory, Locale locale, String inputEncoding,
+ String outputEncoding )
+ throws SiteToolException;
+
+ /**
+ * Populate the report menu part of the decoration model.
+ *
+ * @param decorationModel the Doxia DecorationModel, not null.
+ * @param locale the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
+ * @param categories a map to put on the decoration model, not null.
+ */
+ void populateReportsMenu( DecorationModel decorationModel, Locale locale, Map categories );
+
+ /**
+ * Interpolating several expressions in the site descriptor content. Actually, the expressions could be on
+ * the project, the environment variables and the specific properties like <code>encoding</code>.
+ * <p/>
+ * For instance:
+ * <dl>
+ * <dt>${project.name}</dt>
+ * <dd>The value from the POM of:
+ * <p>
+ * <project><br>
+ * <name>myProjectName</name><br>
+ * </project>
+ * </p></dd>
+ * <dt>${my.value}</dt>
+ * <dd>The value from the POM of:
+ * <p>
+ * <properties><br>
+ * <my.value>hello</my.value><br>
+ * </properties>
+ * </p></dd>
+ * <dt>${JAVA_HOME}</dt>
+ * <dd>The value of JAVA_HOME in the environment variables</dd>
+ * </dl>
+ *
+ * @param props a map used for interpolation, not null.
+ * @param aProject a Maven project, not null.
+ * @param inputEncoding the input encoding of the site descriptor, not null.
+ * @param outputEncoding the output encoding wanted, not null.
+ * @param siteDescriptorContent the site descriptor file, not null.
+ * @return the site descriptor content based on the <code>site.xml</code> file with interpolated strings.
+ * @throws SiteToolException if errors happened during the interpolation.
+ */
+ String getInterpolatedSiteDescriptorContent( Map props, MavenProject aProject, String siteDescriptorContent,
+ String inputEncoding, String outputEncoding )
+ throws SiteToolException;
+
+ /**
+ * Returns the parent POM with interpolated URLs. Attempts to source this value from the
+ * <code>reactorProjects</code> parameters if available (reactor env model attributes
+ * are interpolated), or if the reactor is unavailable (-N) resorts to the
+ * <code>project.getParent().getUrl()</code> value which will NOT have be interpolated.
+ * <p/>
+ * TODO: once bug is fixed in Maven proper, remove this.
+ *
+ * @param aProject a Maven project, not null.
+ * @param reactorProjects the Maven reactor projects, not null.
+ * @param localRepository the Maven local repository, not null.
+ * @return the parent project with interpolated URLs.
+ */
+ MavenProject getParentProject( MavenProject aProject, List reactorProjects, ArtifactRepository localRepository );
+
+ /**
+ * @param decorationModel the Doxia DecorationModel, not null.
+ * @param locale the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
+ * @param project a Maven project, not null.
+ * @param parentProject a Maven parent project, not null.
+ * @param keepInheritedRefs used for inherited references.
+ */
+ void populateProjectParentMenu( DecorationModel decorationModel, Locale locale, MavenProject project,
+ MavenProject parentProject, boolean keepInheritedRefs );
+
+ /**
+ * @param project a Maven project, not null.
+ * @param reactorProjects the Maven reactor projects, not null.
+ * @param localRepository the Maven local repository, not null.
+ * @param decorationModel the Doxia site descriptor model, not null.
+ * @param locale the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
+ * @param keepInheritedRefs used for inherited references.
+ * @throws SiteToolException if any
+ */
+ void populateModules( MavenProject project, List reactorProjects, ArtifactRepository localRepository,
+ DecorationModel decorationModel, Locale locale, boolean keepInheritedRefs )
throws SiteToolException;
}
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Parent Project
+decorationModel.menu.projectdocumentation = Project Documentation
+decorationModel.menu.projectinformation = Project Information
+decorationModel.menu.projectmodules = Modules
+decorationModel.menu.projectreports = Project Reports
\ No newline at end of file
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Nad\u0159azen\u00fd projekt
+decorationModel.menu.projectdocumentation = Dokumentace projektu
+decorationModel.menu.projectinformation = Informace o projektu
+decorationModel.menu.projectmodules = Moduly
+decorationModel.menu.projectreports = Souhrny projektu
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_cs.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = \u00fcbergeordnetes Projekt
+decorationModel.menu.projectdocumentation = Projektdokumentation
+decorationModel.menu.projectinformation = Projektinformationen
+decorationModel.menu.projectmodules = Module
+decorationModel.menu.projectreports = Projektberichte
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_de.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,23 @@
+# 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.
+
+# NOTE:
+# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
+# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
+# JVM's default locale (which need not be "en"). See the method javadoc about
+# ResourceBundle.getBundle(String, Locale, ClassLoader)
+# for a full description of the lookup strategy.
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_en.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Proyecto padre
+decorationModel.menu.projectdocumentation = Documentaci\u00f3n del proyecto
+decorationModel.menu.projectinformation = Informaci\u00f3n del proyecto
+decorationModel.menu.projectmodules = M\u00f3dulos
+decorationModel.menu.projectreports = Informes del proyecto
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_es.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Projet parent
+decorationModel.menu.projectdocumentation = Documentation sur le projet
+decorationModel.menu.projectinformation = Info Projet
+decorationModel.menu.projectmodules = Modules
+decorationModel.menu.projectreports = Rapports Projet
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_fr.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Sz\u00fcl\u0151 projekt
+decorationModel.menu.projectdocumentation = Projekt dokument\u00e1ci\u00f3
+decorationModel.menu.projectinformation = Projekt inform\u00e1ci\u00f3
+decorationModel.menu.projectmodules = Modulok
+decorationModel.menu.projectreports = Projekt riportok
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_hu.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Progetto Padre
+decorationModel.menu.projectdocumentation = Documentazione del Progetto
+decorationModel.menu.projectinformation = Informazioni sul Progetto
+decorationModel.menu.projectmodules = Moduli
+decorationModel.menu.projectreports = Rapporti del Progetto
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_it.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = \u89aa\u30d7\u30ed\u30b8\u30a7\u30af\u30c8
+decorationModel.menu.projectdocumentation = \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u6587\u66f8
+decorationModel.menu.projectinformation = \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u60c5\u5831
+decorationModel.menu.projectmodules = \u30e2\u30b8\u30e5\u30fc\u30eb
+decorationModel.menu.projectreports = \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30ec\u30dd\u30fc\u30c8
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ja.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = \ubd80\ubaa8 \ud504\ub85c\uc81d\ud2b8
+decorationModel.menu.projectdocumentation = \ud504\ub85c\uc81d\ud2b8 \ubb38\uc11c\ud654
+decorationModel.menu.projectinformation = \ud504\ub85c\uc81d\ud2b8 \uc815\ubcf4
+decorationModel.menu.projectmodules = \ubaa8\ub4c8
+decorationModel.menu.projectreports = \ud504\ub85c\uc81d\ud2b8 \ubcf4\uace0\uc11c
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_ko.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Bevattend project
+decorationModel.menu.projectdocumentation = Project documentatie
+decorationModel.menu.projectinformation = Project informatie
+decorationModel.menu.projectmodules = Modulen
+decorationModel.menu.projectreports = Project rapporten
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_nl.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Hovedprosjekt
+decorationModel.menu.projectdocumentation = Prosjekt dokumentasjon
+decorationModel.menu.projectinformation = Prosjekt informasjon
+decorationModel.menu.projectmodules = Moduler
+decorationModel.menu.projectreports = Prosjekt rapporter
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_no.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Projekt nadrz\u0119dny
+decorationModel.menu.projectdocumentation = Dokumentacja projektu
+decorationModel.menu.projectinformation = Informacja o projekcie
+decorationModel.menu.projectmodules = Modu\u0142y
+decorationModel.menu.projectreports = Raporty projektu
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pl.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Projeto Pai
+decorationModel.menu.projectdocumentation = Documenta\u00e7\u00e3o do Projeto
+decorationModel.menu.projectinformation = Informa\u00e7\u00f5es sobre o Projeto
+decorationModel.menu.projectmodules = M\u00f3dulo
+decorationModel.menu.projectreports = Relat\u00f3rios do Projeto
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_pt_BR.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = Nadraden\u00fd projekt
+decorationModel.menu.projectdocumentation = Projektov\u00e1 dokument\u00e1cia
+decorationModel.menu.projectinformation = Inform\u00e1cie o projekte
+decorationModel.menu.projectmodules = Moduly
+decorationModel.menu.projectreports = Projektov\u00e9 zostavy
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_sk.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties?rev=615593&view=auto
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties (added)
+++ maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties Sun Jan 27 05:21:32 2008
@@ -0,0 +1,22 @@
+# 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.
+
+decorationModel.menu.parentproject = \u7236\u9879\u76ee
+decorationModel.menu.projectdocumentation = \u9879\u76ee\u6587\u6863
+decorationModel.menu.projectinformation = \u9879\u76ee\u4fe1\u606f
+decorationModel.menu.projectmodules = \u6a21\u5757
+decorationModel.menu.projectreports = \u9879\u76ee\u62a5\u8868
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_zh_CN.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java?rev=615593&r1=615592&r2=615593&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java (original)
+++ maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java Sun Jan 27 05:21:32 2008
@@ -20,6 +20,8 @@
*/
import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Locale;
import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -172,5 +174,36 @@
assertEquals( tool.getSiteDescriptorFromRepository( project, getLocalRepo(),
project.getRemoteArtifactRepositories(), Locale.ENGLISH )
.toString(), result );
+ }
+
+ /**
+ * @throws Exception
+ */
+ public void testGetDecorationModel()
+ throws Exception
+ {
+ SiteTool tool = (SiteTool) lookup( SiteTool.ROLE );
+ assertNotNull( tool );
+
+ SiteToolMavenProjectStub project = new SiteToolMavenProjectStub();
+ project.setGroupId( "org.apache.maven" );
+ project.setArtifactId( "maven-site" );
+ project.setVersion( "1.0" );
+ File siteDirectory = new File( project.getBasedir(), "src/site" );
+ List reactorProjects = new ArrayList();
+
+ project.setBasedir( null ); // get it from repo
+
+ DecorationModel model = tool.getDecorationModel( project, reactorProjects, getLocalRepo(), project
+ .getRemoteArtifactRepositories(), siteDirectory, Locale.getDefault(), "ISO-8859-1", "ISO-8859-1" );
+ assertNotNull( model );
+ assertNotNull( model.getBannerLeft() );
+ assertEquals( "Maven", model.getBannerLeft().getName() );
+ assertEquals( "images/apache-maven-project-2.png", model.getBannerLeft().getSrc() );
+ assertEquals( "http://maven.apache.org/", model.getBannerLeft().getHref() );
+ assertNotNull( model.getBannerRight() );
+ assertNull( model.getBannerRight().getName() );
+ assertEquals( "images/maven-logo-2.gif", model.getBannerRight().getSrc() );
+ assertNull( model.getBannerRight().getHref() );
}
}
Modified: maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/stubs/SiteToolMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/stubs/SiteToolMavenProjectStub.java?rev=615593&r1=615592&r2=615593&view=diff
==============================================================================
--- maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/stubs/SiteToolMavenProjectStub.java (original)
+++ maven/shared/trunk/maven-doxia-tools/src/test/java/org/apache/maven/doxia/tools/stubs/SiteToolMavenProjectStub.java Sun Jan 27 05:21:32 2008
@@ -30,7 +30,6 @@
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.model.Build;
import org.apache.maven.model.Model;
-import org.apache.maven.model.Reporting;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
@@ -43,7 +42,7 @@
{
private Build build;
- private Reporting reporting;
+ private File basedir;
public SiteToolMavenProjectStub()
{
@@ -60,6 +59,8 @@
throw new RuntimeException( e );
}
+ basedir = new File( super.getBasedir() + "/src/test/resources/unit/site-tool-test" );
+
setGroupId( model.getGroupId() );
setArtifactId( model.getArtifactId() );
setVersion( model.getVersion() );
@@ -67,14 +68,13 @@
setUrl( model.getUrl() );
setPackaging( model.getPackaging() );
- Build build = new Build();
+ build = new Build();
build.setFinalName( model.getArtifactId() );
build.setDirectory( super.getBasedir() + "/target/test/unit/site-tool-test/target" );
build.setSourceDirectory( getBasedir() + "/src/main/java" );
build.setOutputDirectory( super.getBasedir() + "/target/test/unit/site-tool-test/target/classes" );
build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
build.setTestOutputDirectory( super.getBasedir() + "/target/test/unit/site-tool-test/target/test-classes" );
- setBuild( build );
List compileSourceRoots = new ArrayList();
compileSourceRoots.add( getBasedir() + "/src/main/java" );
@@ -83,9 +83,6 @@
List testCompileSourceRoots = new ArrayList();
testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
setTestCompileSourceRoots( testCompileSourceRoots );
-
- reporting = new Reporting();
- reporting.setOutputDirectory( super.getBasedir() + "/target/test/unit/site-tool-test/target/site" );
}
/** {@inheritDoc} */
@@ -103,7 +100,12 @@
/** {@inheritDoc} */
public File getBasedir()
{
- return new File( super.getBasedir() + "/src/test/resources/unit/site-tool-test" );
+ return basedir;
+ }
+
+ public void setBasedir( File basedir )
+ {
+ this.basedir = basedir;
}
/** {@inheritDoc} */
@@ -113,11 +115,5 @@
new DefaultRepositoryLayout() );
return Collections.singletonList( repository );
- }
-
- /** {@inheritDoc} */
- public Reporting getReporting()
- {
- return this.reporting;
}
}