Author: olamy
Date: Sun Aug 2 23:33:34 2009
New Revision: 800160
URL: http://svn.apache.org/viewvc?rev=800160&view=rev
Log:
add codes to renable reporting working with mvn trunk (branch MNG-4162).
Note hardcoding the report (I will review that later)
Added:
maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT (with props)
Modified:
maven/plugins/branches/maven-site-plugin-3.x/pom.xml
maven/plugins/branches/maven-site-plugin-3.x/src/it/MSITE-265/pom.xml
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDescriptorArtifactMetadata.java
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml
Added: maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT?rev=800160&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT Sun Aug 2 23:33:34
2009
@@ -0,0 +1,3 @@
+to work with this branch you have to use trunk branch MNG-4162
+https://svn.apache.org/repos/asf/maven/components/branches/MNG-4162/
+
Propchange: maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/REAME.TXT
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/plugins/branches/maven-site-plugin-3.x/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/pom.xml?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/pom.xml (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/pom.xml Sun Aug 2 23:33:34
2009
@@ -29,7 +29,7 @@
</parent>
<artifactId>maven-site-plugin</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>3.0-beta-1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Maven Site Plugin</name>
@@ -179,12 +179,18 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
- </dependency>
+ </dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
- <version>3.0-SNAPSHOT</version>
+ <version>2.2.0</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-impl</artifactId>
+ <version>2.0.4.2</version>
+ </dependency>
<!-- Doxia -->
<dependency>
@@ -234,6 +240,20 @@
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-doxia-tools</artifactId>
<version>1.0.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact-manager</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Wagon -->
@@ -252,7 +272,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
- <version>1.0-beta-3.0.8-SNAPSHOT</version>
+ <version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -281,7 +301,7 @@
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.2</version>
+ <version>2.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -291,11 +311,21 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-remote-resources-plugin</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0-beta-1-SNAPSHOT</version>
</plugin>
</plugins>
- </pluginManagement>
+ </pluginManagement>
</build>
<profiles>
@@ -305,6 +335,15 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.3</version>
<configuration>
@@ -367,8 +406,54 @@
</locales>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.2-SNAPSHOT</version>
+ </plugin>
</plugins>
</reporting>
</profile>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <properties>
+ <m2buildDirectory>build</m2buildDirectory>
+ </properties>
+ <build>
+ <directory>${m2buildDirectory}</directory>
+ <plugins>
+ <plugin>
+ <groupId>org.maven.ide.eclipse</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>0.9.9-SNAPSHOT</version>
+ <configuration>
+ <mappingId>customizable</mappingId>
+ <configurators>
+ <configurator id='org.maven.ide.eclipse.jdt.javaConfigurator'
/>
+ <configurator
id='org.maven.ide.eclipse.modello.modelloConfigurator' />
+ <configurator
id='org.maven.ide.eclipse.plexus.annotations.plexusConfigurator' />
+ </configurators>
+ <mojoExecutions>
+
<mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
+ </mojoExecutions>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
</profiles>
</project>
Modified: maven/plugins/branches/maven-site-plugin-3.x/src/it/MSITE-265/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/it/MSITE-265/pom.xml?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/it/MSITE-265/pom.xml
(original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/it/MSITE-265/pom.xml Sun
Aug 2 23:33:34 2009
@@ -46,7 +46,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.0.1</version>
+ <version>2.1.1</version>
<reportSets>
<reportSet>
<reports>
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
Sun Aug 2 23:33:34 2009
@@ -20,7 +20,11 @@
*/
import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
+import org.apache.maven.classrealm.ClassRealmManager;
import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
import org.apache.maven.doxia.site.decoration.DecorationModel;
import
org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler;
@@ -29,12 +33,47 @@
import org.apache.maven.doxia.siterenderer.RendererException;
import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
import org.apache.maven.doxia.tools.SiteToolException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.DefaultLifecycleExecutor;
+import org.apache.maven.lifecycle.LifecycleExecutor;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.ReportPlugin;
+import org.apache.maven.model.ReportSet;
+import org.apache.maven.plugin.CycleDetectedInPluginGraphException;
+import org.apache.maven.plugin.DefaultPluginManager;
+import org.apache.maven.plugin.InvalidPluginDescriptorException;
+import org.apache.maven.plugin.Mojo;
+import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.MojoNotFoundException;
+import org.apache.maven.plugin.PluginDescriptorParsingException;
import org.apache.maven.plugin.PluginManager;
+import org.apache.maven.plugin.PluginNotFoundException;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReport;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.DefaultContainerConfiguration;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.MutablePlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.ComponentDependency;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import
org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.io.File;
import java.io.IOException;
@@ -42,10 +81,12 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
/**
* Base class for site rendering mojos.
@@ -54,7 +95,7 @@
* @version $Id$
*/
public abstract class AbstractSiteRenderingMojo
- extends AbstractSiteMojo
+ extends AbstractSiteMojo implements Contextualizable
{
/**
* Module type exclusion mappings
@@ -96,7 +137,7 @@
* @todo this is used for site descriptor resolution - it should relate to
the actual project but for some reason they are not always filled in
* @parameter expression="${project.remoteArtifactRepositories}"
*/
- protected List repositories;
+ protected List<ArtifactRepository> repositories;
/**
* The component used for creating artifact instances.
@@ -170,43 +211,188 @@
* @readonly
*/
protected MavenProject project;
-
-
+
/**
- * @parameter expression="${reports}"
+ * The component that is used to resolve/execure plugins.
+ *
* @required
* @readonly
+ * @component
*/
- //protected List reports;
+ @Requirement
+ protected PluginManager pluginManager;
/**
- *
- * @component
+ * @parameter expression="${session}"
+ * @required
+ * @readonly
*/
- protected PluginManager pluginManager;
+ protected MavenSession mavenSession;
+
+ Context context;
+
+ PlexusContainer plexusContainer;
+
+ ClassRealmManager classRealmManager;
+
+ DefaultLifecycleExecutor lifecycleExecutor;
- protected List/* MavenReport */ getReports()
+ public void contextualize( Context context )
+ throws ContextException
{
- if (this.project.getReporting() == null)
+ this.context = context;
+ plexusContainer = (PlexusContainer) context.get(
PlexusConstants.PLEXUS_KEY );
+ try
+ {
+ classRealmManager = plexusContainer.lookup(
ClassRealmManager.class );
+ lifecycleExecutor = (DefaultLifecycleExecutor)
plexusContainer.lookup( LifecycleExecutor.class );
+ }
+ catch ( ComponentLookupException e )
+ {
+ throw new ContextException( e.getMessage(), e );
+ }
+
+
+ }
+
+ protected Map<MavenReport, ClassRealm> getReports() throws
MojoExecutionException
+ {
+ if ( this.project.getReporting() == null ||
this.project.getReporting().getPlugins().isEmpty() )
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyMap();
}
- List mavenReports = new ArrayList();
- return mavenReports;
+ return buildMavenReports();
}
- protected List filterReports( List reports )
+ Xpp3Dom convert( MojoDescriptor mojoDescriptor )
{
- List filteredReports = new ArrayList( reports.size() );
- for ( Iterator i = reports.iterator(); i.hasNext(); )
+ Xpp3Dom dom = new Xpp3Dom( "configuration" );
+
+ PlexusConfiguration c = mojoDescriptor.getMojoConfiguration();
+
+ PlexusConfiguration[] ces = c.getChildren();
+
+ if ( ces != null )
+ {
+ for ( PlexusConfiguration ce : ces )
+ {
+ String value = ce.getValue( null );
+ String defaultValue = ce.getAttribute( "default-value", null );
+ if ( value != null || defaultValue != null )
+ {
+ Xpp3Dom e = new Xpp3Dom( ce.getName() );
+ e.setValue( value );
+ if ( defaultValue != null )
+ {
+ e.setAttribute( "default-value", defaultValue );
+ }
+ dom.addChild( e );
+ }
+ }
+ }
+
+ return dom;
+ }
+
+ private Map<MavenReport, ClassRealm> buildMavenReports()
+ throws MojoExecutionException
+ {
+ ClassLoader original = Thread.currentThread().getContextClassLoader();
+ try
+ {
+
+ Map<MavenReport, ClassRealm> reports = new HashMap<MavenReport,
ClassRealm>();
+
+ Set<String> excludes = new HashSet<String>();
+ excludes.add( "maven-reporting-api" );
+ // maven-reporting-impl
+ ArtifactFilter artifactFilter = new ExclusionSetFilter( excludes );
+
+ List<ArtifactFilter> artifactFilters = new
ArrayList<ArtifactFilter>( 1 );
+ artifactFilters.add( artifactFilter );
+
+ for ( ReportPlugin reportPlugin :
this.project.getReporting().getPlugins() )
+ {
+ Plugin plugin = new Plugin();
+ plugin.setGroupId( reportPlugin.getGroupId() );
+ plugin.setArtifactId( reportPlugin.getArtifactId() );
+ plugin.setVersion( reportPlugin.getVersion() );
+
+ List<String> goals = new ArrayList<String>();
+ for ( ReportSet reportSet : reportPlugin.getReportSets() )
+ {
+ goals.addAll( reportSet.getReports() );
+ }
+ plugin.setGoals( goals );
+
+ DefaultPluginManager pm = (DefaultPluginManager)
plexusContainer.lookup( PluginManager.class );
+
+ PluginDescriptor pluginDescriptor = pm.loadPlugin( plugin,
localRepository, repositories );
+
+
+
+ MojoDescriptor mojoDescriptor =
+ pm.getMojoDescriptor( plugin, "project-team",
localRepository,
+
mavenSession.getRequest().getRemoteRepositories() );
+
+ mojoDescriptor.getConfiguration();
+ // currently only one hardcoded report for testing
+ MojoExecution mojoExecution = new MojoExecution( plugin,
"mailing-list", "fake" );
+ mojoExecution.setConfiguration( convert(mojoDescriptor) );
+ mojoExecution.setMojoDescriptor( mojoDescriptor );
+
+ // lifecycleExecutor.populateMojoExecutionConfiguration(
project, mojoExecution, false );
+
+ ClassRealm sitePluginRealm = (ClassRealm)
Thread.currentThread().getContextClassLoader();
+ List<String> excluded = new ArrayList<String>();
+ excluded.add( "org.apache.maven.reporting" );
+ excluded.add( "org.codehaus.doxia.sink" );
+ excluded.add( "org.apache.maven.doxia") ;
+ ClassRealm pluginRealm =
+ pm.getPluginRealm( mavenSession,
mojoDescriptor.getPluginDescriptor(), sitePluginRealm, excluded );//,
artifactFilters );
+
+ /*
+ pluginRealm.importFrom( sitePluginRealm.getId(),
"org.apache.maven.reporting" );
+ pluginRealm.importFrom( sitePluginRealm.getId(),
"org.codehaus.doxia.sink" );
+ pluginRealm.importFrom( sitePluginRealm.getId(),
"org.apache.maven.doxia") ;
+ pluginRealm.setParentRealm( sitePluginRealm );
+ */
+ pluginDescriptor.setClassRealm( pluginRealm );
+ Mojo mojo = (Mojo )pm.getConfiguredMojo( Mojo.class,
mavenSession, project, mojoExecution, pluginRealm );
+
+
+ lifecycleExecutor.populateMojoExecutionConfiguration( project,
mojoExecution, false );
+
+ MavenReport mavenReport = (MavenReport) mojo;
+
+ reports.put( mavenReport, pluginRealm );
+
+ }
+ return reports;
+ }
+ catch ( Exception e )
+ {
+ // FIXME more detailled exception
+
+ throw new MojoExecutionException( "failed to get Reports ", e );
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader( original );
+ }
+ }
+
+ protected Map<MavenReport, ClassRealm> filterReports( Map<MavenReport,
ClassRealm> reports )
+ {
+ Map<MavenReport, ClassRealm> filteredReports = new HashMap<MavenReport,
ClassRealm>();
+ for ( MavenReport report : reports.keySet() )
{
- MavenReport report = (MavenReport) i.next();
//noinspection ErrorNotRethrown,UnusedCatchParameter
try
{
if ( report.canGenerateReport() )
{
- filteredReports.add( report );
+ filteredReports.put( report, reports.get(report) );
}
}
catch ( AbstractMethodError e )
@@ -218,7 +404,7 @@
getLog().warn(
"Error loading report " +
report.getClass().getName()
+ " - AbstractMethodError:
canGenerateReport()" );
- filteredReports.add( report );
+ filteredReports.put( report, reports.get(report) );
}
}
return filteredReports;
@@ -334,10 +520,10 @@
* @return A map with all reports keyed by filename having the report
itself as value. The map will be used to
* populate a menu.
*/
- protected Map locateReports( List reports, Map documents, Locale locale )
+ protected Map locateReports( Map<MavenReport, ClassRealm> reports, Map
documents, Locale locale )
{
Map reportsByOutputName = new HashMap();
- for ( Iterator i = reports.iterator(); i.hasNext(); )
+ for ( Iterator i = reports.keySet().iterator(); i.hasNext(); )
{
MavenReport report = (MavenReport) i.next();
@@ -388,7 +574,7 @@
return categories;
}
- protected Map locateDocuments( SiteRenderingContext context, List reports,
Locale locale )
+ protected Map locateDocuments( SiteRenderingContext context,
Map<MavenReport, ClassRealm> reports, Locale locale )
throws IOException, RendererException
{
Map documents = siteRenderer.locateDocumentFiles( context );
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
Sun Aug 2 23:33:34 2009
@@ -19,8 +19,8 @@
* under the License.
*/
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.artifact.manager.WagonConfigurationException;
+import java.io.File;
+
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Site;
@@ -28,6 +28,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.repository.legacy.WagonConfigurationException;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.CommandExecutionException;
@@ -37,7 +38,6 @@
import org.apache.maven.wagon.TransferFailedException;
import org.apache.maven.wagon.UnsupportedProtocolException;
import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.observers.Debug;
import org.apache.maven.wagon.proxy.ProxyInfo;
@@ -55,8 +55,6 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.util.xml.Xpp3Dom;
-import java.io.File;
-
/**
* Deploys the generated site using <code>scp</code> or <code>file</code>
* protocol to the site URL specified in the
@@ -159,6 +157,7 @@
{
throw new MojoExecutionException( "Unable to configure Wagon: '" +
repository.getProtocol() + "'", e );
}
+
if ( !wagon.supportsDirectoryCopy() )
{
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDescriptorArtifactMetadata.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDescriptorArtifactMetadata.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDescriptorArtifactMetadata.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteDescriptorArtifactMetadata.java
Sun Aug 2 23:33:34 2009
@@ -121,4 +121,10 @@
throw new IllegalStateException( "Cannot add two different pieces
of metadata for: " + getKey() );
}
}
+
+ public void merge(
org.apache.maven.repository.legacy.metadata.ArtifactMetadata metadata )
+ {
+ // FIXME what todo here ?
+
+ }
}
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteMojo.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
Sun Aug 2 23:33:34 2009
@@ -19,17 +19,6 @@
* under the License.
*/
-import org.apache.maven.doxia.siterenderer.RendererException;
-import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.PluginManager;
-import org.apache.maven.reporting.MavenReport;
-import org.apache.maven.settings.Proxy;
-import org.apache.maven.settings.Settings;
-import org.apache.maven.wagon.proxy.ProxyInfo;
-import org.apache.maven.wagon.repository.Repository;
-
import java.io.File;
import java.io.IOException;
import java.util.Collections;
@@ -38,13 +27,20 @@
import java.util.Locale;
import java.util.Map;
+import org.apache.maven.doxia.siterenderer.RendererException;
+import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.PluginManager;
+import org.apache.maven.reporting.MavenReport;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+
/**
* Generates the site for a single project.
* <p>
- * Note that links between module sites in a multi module build will <b>not</b>
- * work.
+ * Note that links between module sites in a multi module build will
<b>not</b> work.
* </p>
- *
+ *
* @author <a href="mailto:[email protected]">Emmanuel Venisse</a>
* @author <a href="mailto:[email protected]">Vincent Siveton</a>
* @version $Id$
@@ -56,7 +52,7 @@
{
/**
* Directory containing the generated project sites and report
distributions.
- *
+ *
* @parameter expression="${siteOutputDirectory}"
default-value="${project.reporting.outputDirectory}"
* @required
*/
@@ -64,34 +60,32 @@
/**
* Convenience parameter that allows you to disable report generation.
- *
+ *
* @parameter expression="${generateReports}" default-value="true"
*/
private boolean generateReports;
-
+
protected PluginManager pluginManager;
/**
* Generate the project site
* <p/>
* throws MojoExecutionException if any
- *
+ *
* @see org.apache.maven.plugin.Mojo#execute()
*/
public void execute()
throws MojoExecutionException, MojoFailureException
{
-
- //pluginManager.executeMojo( session, execution )
-
- List filteredReports;
+
+ Map<MavenReport, ClassRealm> filteredReports;
if ( generateReports )
{
filteredReports = filterReports( getReports() );
}
else
{
- filteredReports = Collections.EMPTY_LIST;
+ filteredReports = Collections.emptyMap();
}
try
@@ -119,8 +113,7 @@
}
}
- private void renderLocale( Locale locale,
- List reports )
+ private void renderLocale( Locale locale, Map<MavenReport, ClassRealm>
reports )
throws IOException, RendererException, MojoFailureException,
MojoExecutionException
{
SiteRenderingContext context = createSiteRenderingContext( locale );
@@ -133,7 +126,7 @@
File outputDirectory = getOutputDirectory( locale );
// For external reports
- for ( Iterator i = reports.iterator(); i.hasNext(); )
+ for ( Iterator i = reports.keySet().iterator(); i.hasNext(); )
{
MavenReport report = (MavenReport) i.next();
report.setReportOutputDirectory( outputDirectory );
@@ -170,5 +163,5 @@
return file;
}
-
+
}
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
Sun Aug 2 23:33:34 2009
@@ -36,6 +36,7 @@
import org.apache.maven.plugins.site.webapp.DoxiaBean;
import org.apache.maven.plugins.site.webapp.DoxiaFilter;
import org.apache.maven.reporting.MavenReport;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.util.IOUtil;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
@@ -151,13 +152,12 @@
// For external reports
project.getReporting().setOutputDirectory(
tempWebappDirectory.getAbsolutePath() );
- for ( Iterator i = getReports().iterator(); i.hasNext(); )
+ for ( MavenReport report : getReports().keySet() )
{
- MavenReport report = (MavenReport) i.next();
report.setReportOutputDirectory( tempWebappDirectory );
}
- List filteredReports = filterReports( getReports() );
+ Map<MavenReport, ClassRealm> filteredReports = filterReports(
getReports() );
List localesList = siteTool.getAvailableLocales( locales );
webapp.setAttribute( DoxiaFilter.LOCALES_LIST_KEY, localesList );
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
Sun Aug 2 23:33:34 2009
@@ -19,11 +19,14 @@
* under the License.
*/
-import org.apache.maven.artifact.manager.WagonConfigurationException;
+import java.io.File;
+import java.util.List;
+
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.repository.legacy.WagonConfigurationException;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.CommandExecutionException;
import org.apache.maven.wagon.CommandExecutor;
@@ -32,10 +35,8 @@
import org.apache.maven.wagon.TransferFailedException;
import org.apache.maven.wagon.UnsupportedProtocolException;
import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.observers.Debug;
-import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.repository.Repository;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
@@ -43,9 +44,6 @@
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-import java.io.File;
-import java.util.List;
-
/**
* Deploys the generated site to a staging or mock directory to the site URL
* specified in the <code><distributionManagement></code> section of the
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java
Sun Aug 2 23:33:34 2009
@@ -46,8 +46,9 @@
assertTrue( pluginXmlFile.exists() );
SiteMojo siteMojo = (SiteMojo) lookupMojo( "site", pluginXmlFile );
+
assertNotNull( siteMojo );
-
+
File descriptorFile = getTestFile(
"src/test/resources/unit/interpolated-site/src/site/site.xml" );
assertNotNull( descriptorFile );
assertTrue( descriptorFile.exists() );
Modified:
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml?rev=800160&r1=800159&r2=800160&view=diff
==============================================================================
---
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml
(original)
+++
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml
Sun Aug 2 23:33:34 2009
@@ -63,6 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
+ <version>3.0-SNAPSHOT</version>
<configuration>
<project
implementation="org.apache.maven.plugins.site.stubs.SiteMavenProjectStub"/>
<inputEncoding>ISO-8859-1</inputEncoding>