You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2010/08/31 00:22:38 UTC
svn commit: r991009 - in /maven/plugins/branches/maven-site-plugin-3.x: ./
src/main/java/org/apache/maven/plugins/site/
src/test/java/org/apache/maven/plugins/site/
src/test/java/org/apache/maven/plugins/site/stubs/
src/test/resources/unit/deploy-dav/ ...
Author: olamy
Date: Mon Aug 30 22:22:37 2010
New Revision: 991009
URL: http://svn.apache.org/viewvc?rev=991009&view=rev
Log:
[MSITE-481] Deploy site:deploy not working for maven 3 for DAV
add junit for dav deploy (thru proxy and thru proxy with authz)
Added:
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css (with props)
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html (with props)
Modified:
maven/plugins/branches/maven-site-plugin-3.x/pom.xml
maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/DefaultMavenReportExecutor.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/SiteStageDeployMojo.java
maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/stubs/SiteMavenProjectStub.java
maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/interpolated-site/pom.xml
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=991009&r1=991008&r2=991009&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/pom.xml (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/pom.xml Mon Aug 30 22:22:37 2010
@@ -164,7 +164,7 @@ under the License.
<properties>
<doxiaVersion>1.1.3</doxiaVersion>
<doxiaSitetoolsVersion>1.1.3</doxiaSitetoolsVersion>
- <mavenVersion>3.0-SNAPSHOT</mavenVersion>
+ <mavenVersion>3.0-beta-3</mavenVersion>
<wagonVersion>1.0-beta-6</wagonVersion>
<plexusVersion>1.5.4</plexusVersion>
<javadocPluginVersion>2.6.1</javadocPluginVersion>
@@ -228,6 +228,12 @@ under the License.
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-core</artifactId>
<version>${doxiaVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -343,6 +349,12 @@ under the License.
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>${wagonVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-nop</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- Plexus -->
@@ -372,8 +384,36 @@ under the License.
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
- <version>6.1.5</version>
+ <version>6.1.25</version>
</dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-client</artifactId>
+ <version>6.1.25</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- note slf4j- upgrade possible until upgrade wagon-webdav-jackrabbit is upgraded too -->
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.3</version>
+
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.1</version>
+ </dependency>
<!-- test -->
<dependency>
Modified: maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/DefaultMavenReportExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/DefaultMavenReportExecutor.java?rev=991009&r1=991008&r2=991009&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/DefaultMavenReportExecutor.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/main/java/org/apache/maven/plugins/site/DefaultMavenReportExecutor.java Mon Aug 30 22:22:37 2010
@@ -55,6 +55,7 @@ import org.codehaus.plexus.util.StringUt
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.Xpp3DomUtils;
import org.mortbay.log.Log;
+import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.util.filter.ExclusionsDependencyFilter;
/**
@@ -156,8 +157,9 @@ public class DefaultMavenReportExecutor
List<String> goals = new ArrayList<String>();
+ List<RemoteRepository> remoteRepositories = session.getCurrentProject().getRemotePluginRepositories();
- PluginDescriptor pluginDescriptor = mavenPluginManager.getPluginDescriptor(plugin, session.getCurrentProject().getRemotePluginRepositories(), session.getRepositorySession());
+ PluginDescriptor pluginDescriptor = mavenPluginManager.getPluginDescriptor(plugin, remoteRepositories , session.getRepositorySession());
if ( reportPlugin.getReportSets().isEmpty() )
{
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=991009&r1=991008&r2=991009&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 Mon Aug 30 22:22:37 2010
@@ -20,9 +20,14 @@ package org.apache.maven.plugins.site;
*/
import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Site;
import org.apache.maven.plugin.AbstractMojo;
@@ -30,8 +35,12 @@ import org.apache.maven.plugin.MojoExecu
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.Proxy;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
+import org.apache.maven.settings.crypto.SettingsDecryptionResult;
import org.apache.maven.wagon.CommandExecutionException;
import org.apache.maven.wagon.CommandExecutor;
import org.apache.maven.wagon.ConnectionException;
@@ -43,11 +52,11 @@ import org.apache.maven.wagon.authentica
import org.apache.maven.wagon.authentication.AuthenticationInfo;
import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.observers.Debug;
-import org.apache.maven.wagon.providers.webdav.WebDavWagon;
import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.repository.Repository;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
import org.codehaus.plexus.component.configurator.ComponentConfigurator;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
@@ -76,7 +85,8 @@ import org.codehaus.plexus.util.xml.Xpp3
* @goal deploy
*/
public class SiteDeployMojo
- extends AbstractMojo implements Contextualizable
+ extends AbstractMojo
+ implements Contextualizable
{
/**
* Directory containing the generated project sites and report distributions.
@@ -133,6 +143,22 @@ public class SiteDeployMojo
* @readonly
*/
private Settings settings;
+
+ /**
+ * @parameter expression="${session}"
+ * @required
+ * @readonly
+ * @since 3.0-beta-2
+ */
+ protected MavenSession mavenSession;
+
+
+ /**
+ * @since 3.0-beta-2
+ * @component
+ * @readonly
+ */
+ private SettingsDecrypter settingsDecrypter;
private PlexusContainer container;
@@ -176,11 +202,22 @@ public class SiteDeployMojo
// TODO: work on moving this into the deployer like the other deploy methods
Wagon wagon;
-
+
+ String protocol = repository.getProtocol();
+
+ getLog().debug( "repository protocol " + protocol );
+
+ ProxyInfo proxyInfo = getProxy( protocol, url, getLog(), mavenSession, settingsDecrypter );
+ getLog().debug( "found proxyInfo "
+ + ( proxyInfo == null ? "null" : "host:port " + proxyInfo.getHost() + ":"
+ + proxyInfo.getPort() + ", " + proxyInfo.getUserName() ) );
+ AuthenticationInfo authenticationInfo = wagonManager.getAuthenticationInfo( id );
+ getLog().debug( "authenticationInfo with id '" + id + "' : " + authenticationInfo.getUserName() );
+
try
{
wagon = wagonManager.getWagon( repository );
- configureWagon( wagon, repository.getId(), settings, container, getLog() );
+ configureWagon( wagon, repository, settings, container, getLog() );
}
catch ( UnsupportedProtocolException e )
{
@@ -206,13 +243,6 @@ public class SiteDeployMojo
wagon.addTransferListener( debug );
- ProxyInfo proxyInfo = getProxyInfo( repository, wagonManager );
- getLog().debug( "found proxyInfo "
- + ( proxyInfo == null ? "null" : "host:port " + proxyInfo.getHost() + ":"
- + proxyInfo.getPort() + ", " + proxyInfo.getUserName() ) );
- AuthenticationInfo authenticationInfo = wagonManager.getAuthenticationInfo( id );
- getLog().debug( "authenticationInfo with id '" + id + "' : " + authenticationInfo.getUserName() );
-
if ( proxyInfo != null )
{
getLog().debug( "connect with proxyInfo" );
@@ -291,12 +321,15 @@ public class SiteDeployMojo
* @param wagonManager the WagonManager used to connect to the Repository.
* @return a ProxyInfo object instantiated or <code>null</code> if no matching proxy is found
*/
- public static ProxyInfo getProxyInfo( Repository repository, WagonManager wagonManager )
+ public static ProxyInfo getProxyInfo( Repository repository, WagonManager wagonManager, Log log )
{
+
ProxyInfo proxyInfo = wagonManager.getProxy( repository.getProtocol() );
+
if ( proxyInfo == null )
{
+ log.debug( "no ProxyInfo for Repository 'id' " + repository.getId() + " 'protocol' " + repository.getProtocol() );
return null;
}
@@ -338,6 +371,75 @@ public class SiteDeployMojo
return proxyInfo;
}
+
+ public static ProxyInfo getProxy( String protocol, String url, Log log, MavenSession mavenSession, SettingsDecrypter settingsDecrypter )
+ {
+ String originalProtocol = protocol;
+ // olamy : hackish here protocol (wagon hint in fact !) is dav
+ // but the real protocol (transport layer) is http(s)
+ // and it's the one use in wagon to find the proxy arghhh
+ // so we will check both
+ if (StringUtils.equalsIgnoreCase( "dav", protocol ) && StringUtils.startsWith( url, "dav:" ))
+ {
+ url = StringUtils.substringAfter( url, "dav:" );
+ if (StringUtils.startsWith( url, "http" ))
+ {
+ try
+ {
+ URL urlSite = new URL( url );
+ protocol = urlSite.getProtocol();
+ log.debug( "find dav protocol so transform to real transport protocol " + protocol );
+ }
+ catch ( MalformedURLException e )
+ {
+ log.warn( "fail to build URL with " + url );
+ }
+
+ }
+ }
+ else
+ {
+ log.debug( "getProxy 'protocol' : " + protocol );
+ }
+ if ( mavenSession != null && protocol != null )
+ {
+ MavenExecutionRequest request = mavenSession.getRequest();
+
+ if ( request != null )
+ {
+ List<Proxy> proxies = request.getProxies();
+
+ if ( proxies != null )
+ {
+ for ( Proxy proxy : proxies )
+ {
+ if ( proxy.isActive()
+ && ( protocol.equalsIgnoreCase( proxy.getProtocol() ) || originalProtocol
+ .equalsIgnoreCase( proxy.getProtocol() ) ) )
+ {
+ SettingsDecryptionResult result = settingsDecrypter
+ .decrypt( new DefaultSettingsDecryptionRequest( proxy ) );
+ proxy = result.getProxy();
+
+ ProxyInfo proxyInfo = new ProxyInfo();
+ proxyInfo.setHost( proxy.getHost() );
+ // so hackish for wagon the protocol is https for site dav : dav:https://dav.codehaus.org/mojo/
+ proxyInfo.setType( protocol );//proxy.getProtocol() );
+ proxyInfo.setPort( proxy.getPort() );
+ proxyInfo.setNonProxyHosts( proxy.getNonProxyHosts() );
+ proxyInfo.setUserName( proxy.getUsername() );
+ proxyInfo.setPassword( proxy.getPassword() );
+
+ return proxyInfo;
+ }
+ }
+ }
+ }
+ }
+ log.debug( "getProxy 'protocol' : " + protocol + " no ProxyInfo found");
+ return null;
+ }
+
/**
* Configure the Wagon with the information from serverConfigurationMap ( which comes from settings.xml )
@@ -350,17 +452,19 @@ public class SiteDeployMojo
* @param log
* @throws WagonConfigurationException
*/
- static void configureWagon( Wagon wagon, String repositoryId, Settings settings, PlexusContainer container,
+ static void configureWagon( Wagon wagon, Repository repository, Settings settings, PlexusContainer container,
Log log )
throws WagonConfigurationException
{
log.debug( " configureWagon " );
+
// MSITE-25: Make sure that the server settings are inserted
for ( int i = 0; i < settings.getServers().size(); i++ )
{
Server server = (Server) settings.getServers().get( i );
+ log.debug( "configureWagon server " + server.getId() );
String id = server.getId();
- if ( id != null && id.equals( repositoryId ) )
+ if ( id != null && id.equals( repository.getId() ) )
{
if ( server.getConfiguration() != null )
{
@@ -376,12 +480,12 @@ public class SiteDeployMojo
}
catch ( final ComponentLookupException e )
{
- throw new WagonConfigurationException( repositoryId, "Unable to lookup wagon configurator."
+ throw new WagonConfigurationException( repository.getId(), "Unable to lookup wagon configurator."
+ " Wagon configuration cannot be applied.", e );
}
catch ( ComponentConfigurationException e )
{
- throw new WagonConfigurationException( repositoryId, "Unable to apply wagon configuration.",
+ throw new WagonConfigurationException( repository.getId(), "Unable to apply wagon configuration.",
e );
}
finally
@@ -398,9 +502,7 @@ public class SiteDeployMojo
}
}
}
-
}
-
}
}
}
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=991009&r1=991008&r2=991009&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 Mon Aug 30 22:22:37 2010
@@ -22,12 +22,16 @@ package org.apache.maven.plugins.site;
import java.io.File;
import java.util.List;
+import javax.inject.Inject;
+
import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.execution.MavenSession;
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.settings.crypto.SettingsDecrypter;
import org.apache.maven.wagon.CommandExecutionException;
import org.apache.maven.wagon.CommandExecutor;
import org.apache.maven.wagon.ConnectionException;
@@ -36,9 +40,12 @@ import org.apache.maven.wagon.TransferFa
import org.apache.maven.wagon.UnsupportedProtocolException;
import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
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.PlexusContainer;
/**
* Deploys the generated site to a staging or mock directory to the site URL
@@ -117,6 +124,16 @@ public class SiteStageDeployMojo
* @readonly
*/
private Settings settings;
+
+ /**
+ * @since 3.0-beta-2
+ * @component
+ * @readonly
+ */
+ private SettingsDecrypter settingsDecrypter;
+
+ @Inject
+ private PlexusContainer container;
/**
* {@inheritDoc}
@@ -148,12 +165,25 @@ public class SiteStageDeployMojo
Repository repository = new Repository( stagingRepositoryId, stagingSiteURL );
+ // TODO: work on moving this into the deployer like the other deploy methods
+
Wagon wagon;
+
+ String protocol = repository.getProtocol();
+
+ getLog().debug( "repository protocol " + protocol );
+
+ ProxyInfo proxyInfo = SiteDeployMojo.getProxy( protocol, stagingSiteURL, getLog(), mavenSession, settingsDecrypter );
+ getLog().debug( "found proxyInfo "
+ + ( proxyInfo == null ? "null" : "host:port " + proxyInfo.getHost() + ":"
+ + proxyInfo.getPort() + ", " + proxyInfo.getUserName() ) );
+ AuthenticationInfo authenticationInfo = wagonManager.getAuthenticationInfo( stagingRepositoryId );
+ getLog().debug( "authenticationInfo with id '" + stagingRepositoryId + "' : " + authenticationInfo.getUserName() );
+
try
{
wagon = wagonManager.getWagon( repository );
- SiteDeployMojo.configureWagon( wagon, stagingRepositoryId, settings, plexusContainer, getLog() );
- wagon.connect( repository );
+ SiteDeployMojo.configureWagon( wagon, repository, settings, container, getLog() );
}
catch ( UnsupportedProtocolException e )
{
@@ -162,15 +192,9 @@ public class SiteStageDeployMojo
catch ( WagonConfigurationException e )
{
throw new MojoExecutionException( "Unable to configure Wagon: '" + repository.getProtocol() + "'", e );
- } catch (AuthenticationException e)
- {
- throw new MojoExecutionException( "AuthenticationException : Unable to connect Wagon to repository : '" + repository.getProtocol() + "'", e );
- }
- catch ( ConnectionException e )
- {
- throw new MojoExecutionException( "Unable to connect Wagon to repository : '" + repository.getProtocol() + "'", e );
}
+
if ( !wagon.supportsDirectoryCopy() )
{
throw new MojoExecutionException(
@@ -181,23 +205,25 @@ public class SiteStageDeployMojo
{
Debug debug = new Debug();
-
wagon.addSessionListener( debug );
wagon.addTransferListener( debug );
- /*
- ProxyInfo proxyInfo = SiteDeployMojo.getProxyInfo( repository, wagonManager );
if ( proxyInfo != null )
{
- wagon.connect( repository, wagonManager.getAuthenticationInfo( stagingRepositoryId ), proxyInfo );
+ getLog().debug( "connect with proxyInfo" );
+ wagon.connect( repository, authenticationInfo, proxyInfo );
+ }
+ else if ( proxyInfo == null && authenticationInfo != null )
+ {
+ getLog().debug( "connect with authenticationInfo and without proxyInfo" );
+ wagon.connect( repository, authenticationInfo );
}
else
{
- wagon.connect( repository, wagonManager.getAuthenticationInfo( stagingRepositoryId ) );
+ getLog().debug( "connect without authenticationInfo and without proxyInfo" );
+ wagon.connect( repository );
}
- */
- wagon.connect( repository );
wagon.putDirectory( new File( stagingDirectory, getStructure( project, false ) ), "." );
getLog().debug( "putDirectory end ok " );
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java Mon Aug 30 22:22:37 2010
@@ -0,0 +1,276 @@
+package org.apache.maven.plugins.site;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.doxia.tools.SiteTool;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.plugins.site.SimpleDavServerHandler.HttpRequest;
+import org.apache.maven.plugins.site.stubs.SiteMavenProjectStub;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
+import org.codehaus.plexus.util.ReflectionUtils;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @version $Id$
+ */
+@RunWith(JUnit4.class)
+public abstract class AbstractSiteDeployWebDavTest
+ extends AbstractMojoTestCase
+{
+
+ File siteTargetPath = new File(getBasedir() + File.separator + "target" + File.separator + "siteTargetDeploy");
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ @Before
+ public void setUp()
+ throws Exception
+ {
+ super.setUp();
+ if (!siteTargetPath.exists())
+ {
+ siteTargetPath.mkdirs();
+ FileUtils.cleanDirectory( siteTargetPath );
+ }
+ getContainer().getLoggerManager().setThreshold( com.jcraft.jsch.Logger.DEBUG );
+ }
+
+ abstract String getMojoName();
+
+ abstract AbstractMojo getMojo( File pluginXmlFile ) throws Exception;
+
+ @Test
+ public void noAuthzDavDeploy() throws Exception
+ {
+ FileUtils.cleanDirectory( siteTargetPath );
+ SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( siteTargetPath );
+ try
+ {
+ File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
+ AbstractMojo mojo = getMojo( pluginXmlFile );
+ assertNotNull( mojo );
+ SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml");
+
+ siteMavenProjectStub.getDistributionManagement().getSite()
+ .setUrl( "dav:http://localhost:" + simpleDavServerHandler.getPort() + "/site/" );
+
+ setVariableValueToObject( mojo, "project", siteMavenProjectStub );
+ Settings settings = new Settings();
+ setVariableValueToObject( mojo, "settings", settings );
+ File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+
+ setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
+ mojo.execute();
+
+ assertContentInFiles();
+ assertFalse( requestsContainsProxyUse( simpleDavServerHandler.httpRequests ) );
+ }
+ finally
+ {
+ simpleDavServerHandler.stop();
+ }
+ }
+
+ @Test
+ public void davDeployThruProxyWithoutAuthzInProxy()
+ throws Exception
+ {
+
+ FileUtils.cleanDirectory( siteTargetPath );
+ SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( siteTargetPath );
+ try
+ {
+ File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
+ AbstractMojo mojo = getMojo( pluginXmlFile );
+ assertNotNull( mojo );
+ SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml");
+ // olamy, Note : toto is something like foo or bar for french folks :-)
+ String siteUrl = "dav:http://toto.com/site/";
+ siteMavenProjectStub.getDistributionManagement().getSite().setUrl( siteUrl );
+
+ setVariableValueToObject( mojo, "project", siteMavenProjectStub );
+ Settings settings = new Settings();
+ Proxy proxy = new Proxy();
+
+ //dummy proxy
+ proxy.setActive( true );
+ proxy.setHost( "localhost" );
+ proxy.setPort( simpleDavServerHandler.getPort() );
+ proxy.setProtocol( "http" );
+ proxy.setNonProxyHosts( "www.google.com|*.somewhere.com" );
+ settings.addProxy( proxy );
+
+ setVariableValueToObject( mojo, "settings", settings );
+
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+ request.setProxies( Arrays.asList( proxy ) );
+ MavenSession mavenSession = new MavenSession( getContainer(), null, request, null );
+
+ setVariableValueToObject( mojo, "mavenSession", mavenSession );
+
+ SettingsDecrypter settingsDecrypter = getContainer().lookup( SettingsDecrypter.class );
+ setVariableValueToObject( mojo, "settingsDecrypter", settingsDecrypter );
+
+ File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+
+ setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
+ mojo.execute();
+
+ assertContentInFiles();
+
+ assertTrue( requestsContainsProxyUse( simpleDavServerHandler.httpRequests ) );
+
+ for (HttpRequest rq : simpleDavServerHandler.httpRequests)
+ {
+ log.info( rq.toString() );
+ }
+
+ }
+ finally
+ {
+ simpleDavServerHandler.stop();
+ }
+
+ }
+
+ @Test
+ public void davDeployThruProxyWitAuthzInProxy() throws Exception
+ {
+
+ FileUtils.cleanDirectory( siteTargetPath );
+ //SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( siteTargetPath );
+
+ Map authentications = new HashMap();
+ authentications.put( "foo", "titi" );
+
+ AuthAsyncProxyServlet servlet = new AuthAsyncProxyServlet(authentications, siteTargetPath);
+
+ SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( servlet );
+ try
+ {
+ File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
+ AbstractMojo mojo = getMojo( pluginXmlFile );
+ assertNotNull( mojo );
+ SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml");
+
+ siteMavenProjectStub.getDistributionManagement().getSite()
+ .setUrl( "dav:http://toto.com/site/" );
+
+ setVariableValueToObject( mojo, "project", siteMavenProjectStub );
+ Settings settings = new Settings();
+ Proxy proxy = new Proxy();
+
+ //dummy proxy
+ proxy.setActive( true );
+ proxy.setHost( "localhost" );
+ proxy.setPort( simpleDavServerHandler.getPort() );
+ proxy.setProtocol( "dav" );
+ proxy.setUsername( "foo" );
+ proxy.setPassword( "titi" );
+ proxy.setNonProxyHosts( "www.google.com|*.somewhere.com" );
+ settings.addProxy( proxy );
+
+ setVariableValueToObject( mojo, "settings", settings );
+
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+ request.setProxies( Arrays.asList( proxy ) );
+ MavenSession mavenSession = new MavenSession( getContainer(), null, request, null );
+
+ setVariableValueToObject( mojo, "mavenSession", mavenSession );
+
+ SettingsDecrypter settingsDecrypter = getContainer().lookup( SettingsDecrypter.class );
+ setVariableValueToObject( mojo, "settingsDecrypter", settingsDecrypter );
+
+ File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+
+ // test which mojo we are using
+ if (ReflectionUtils.getFieldByNameIncludingSuperclasses( "inputDirectory", mojo.getClass() ) != null)
+ {
+ setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
+ }
+ else
+ {
+ ArtifactRepositoryFactory artifactRepositoryFactory = getContainer().lookup( ArtifactRepositoryFactory.class );
+ ;
+ setVariableValueToObject( mojo, "stagingDirectory", inputDirectory );
+ setVariableValueToObject( mojo, "reactorProjects", new ArrayList() );
+ setVariableValueToObject( mojo, "localRepository",
+ artifactRepositoryFactory.createArtifactRepository( "local", "foo", "default",
+ null, null ) );
+ setVariableValueToObject( mojo, "siteTool", getContainer().lookup( SiteTool.class ) );
+ setVariableValueToObject( mojo, "siteDirectory", new File("foo") );
+ setVariableValueToObject( mojo, "repositories", new ArrayList() );
+ }
+ mojo.execute();
+
+ assertContentInFiles();
+ assertTrue( requestsContainsProxyUse( servlet.httpRequests ) );
+ assertAtLeastOneRequestContainsHeader(servlet.httpRequests, "Proxy-Authorization");
+ for (HttpRequest rq : servlet.httpRequests)
+ {
+ log.info( rq.toString() );
+ }
+ }
+ finally
+ {
+ simpleDavServerHandler.stop();
+ }
+ }
+
+ private void assertContentInFiles()
+ throws Exception
+ {
+ File fileToTest = new File( siteTargetPath, "site" + File.separator + "index.html" );
+ assertTrue( fileToTest.exists() );
+ String fileContent = FileUtils.readFileToString( fileToTest );
+ assertTrue( fileContent.contains( "Welcome to Apache Maven" ) );
+
+ fileToTest = new File( siteTargetPath, "site" + File.separator + "css" + File.separator + "maven-base.css" );
+ assertTrue( fileToTest.exists() );
+ fileContent = FileUtils.readFileToString( fileToTest );
+ assertTrue( fileContent.contains( "background-image: url(../images/collapsed.gif);" ) );
+ }
+
+ /**
+ * @param requests
+ * @return true if at least on request use proxy http header Proxy-Connection : Keep-Alive
+ */
+ private boolean requestsContainsProxyUse( List<HttpRequest> requests )
+ {
+ return assertAtLeastOneRequestContainsHeader(requests, "Proxy-Connection");
+ }
+
+ private boolean assertAtLeastOneRequestContainsHeader(List<HttpRequest> requests , String headerName)
+ {
+ for ( HttpRequest rq : requests )
+ {
+ boolean containsProxyHeader = rq.headers.containsKey( headerName );
+ if ( containsProxyHeader )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java Mon Aug 30 22:22:37 2010
@@ -0,0 +1,172 @@
+package org.apache.maven.plugins.site;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.maven.plugins.site.SimpleDavServerHandler.HttpRequest;
+import org.mortbay.jetty.security.B64Code;
+import org.mortbay.proxy.AsyncProxyServlet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since
+ * @version $Id$
+ */
+public class AuthAsyncProxyServlet
+extends AsyncProxyServlet
+{
+ private Map authentications;
+
+ private long sleepTime = 0;
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ List<HttpRequest> httpRequests = new ArrayList<HttpRequest>();
+
+ private File siteTargetPath;
+
+ /**
+ * Constructor for non authentication servlet.
+ */
+ public AuthAsyncProxyServlet( File siteTargetPath )
+ {
+ super();
+ this.siteTargetPath = siteTargetPath;
+ }
+
+ /**
+ * Constructor for authentication servlet.
+ *
+ * @param authentications a map of user/password
+ */
+ public AuthAsyncProxyServlet( Map authentications, File siteTargetPath )
+ {
+ this( siteTargetPath );
+
+ this.authentications = authentications;
+ }
+
+ /**
+ * Constructor for authentication servlet.
+ *
+ * @param authentications a map of user/password
+ * @param sleepTime a positive time to sleep the service thread (for timeout)
+ */
+ public AuthAsyncProxyServlet( Map authentications, long sleepTime, File siteTargetPath )
+ {
+ this( siteTargetPath );
+
+ this.authentications = authentications;
+ this.sleepTime = sleepTime;
+ }
+
+ /** {@inheritDoc} */
+ public void service( ServletRequest req, ServletResponse res )
+ throws ServletException, IOException
+ {
+ final HttpServletRequest request = (HttpServletRequest) req;
+ final HttpServletResponse response = (HttpServletResponse) res;
+
+ log.info( "handle " );
+
+ if ( this.authentications != null && !this.authentications.isEmpty() )
+ {
+ String proxyAuthorization = request.getHeader( "Proxy-Authorization" );
+ if ( proxyAuthorization != null && proxyAuthorization.startsWith( "Basic " ) )
+ {
+ String proxyAuth = proxyAuthorization.substring( 6 );
+ String authorization = B64Code.decode( proxyAuth );
+ String[] authTokens = authorization.split( ":" );
+ String user = authTokens[0];
+ String password = authTokens[1];
+
+ if ( this.authentications.get( user ) == null )
+ {
+ throw new IllegalArgumentException( user + " not found in the map!" );
+ }
+
+ if ( sleepTime > 0 )
+ {
+ try
+ {
+ Thread.sleep( sleepTime );
+ }
+ catch ( InterruptedException e )
+ {
+ // nop
+ }
+ }
+ String authPass = this.authentications.get( user ).toString();
+ if ( password.equals( authPass ) )
+ {
+ String targetPath = request.getServletPath();
+
+ HttpRequest rq = new HttpRequest();
+ rq.method = request.getMethod();
+ rq.path = targetPath;
+
+ Enumeration headerNames = request.getHeaderNames();
+ while ( headerNames.hasMoreElements() )
+ {
+ String name = (String) headerNames.nextElement();
+ rq.headers.put( name, request.getHeader( name ) );
+ }
+
+ httpRequests.add( rq );
+
+ if ( request.getMethod().equalsIgnoreCase( "PUT" ) && targetPath != null )
+ {
+ File targetFile = new File( siteTargetPath, targetPath );
+ log.info( "writing file " + targetFile.getPath() );
+ FileUtils.writeByteArrayToFile( targetFile, IOUtils.toByteArray( request.getInputStream() ) );
+ }
+
+ //PrintWriter writer = response.getWriter();
+
+ response.setStatus( HttpServletResponse.SC_OK );
+ return;
+ }
+ }
+
+ // Proxy-Authenticate Basic realm="CCProxy Authorization"
+ response.addHeader( "Proxy-Authenticate", "Basic realm=\"Jetty Proxy Authorization\"" );
+ response.setStatus( HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED );
+ return;
+ }
+
+ super.service( req, res );
+ }
+}
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java Mon Aug 30 22:22:37 2010
@@ -0,0 +1,159 @@
+package org.apache.maven.plugins.site;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.SystemUtils;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.AbstractHandler;
+import org.mortbay.jetty.servlet.Context;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 3.0-beta-2
+ * @version $Id$
+ */
+public class SimpleDavServerHandler
+{
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ private Server server;
+
+ private File siteTargetPath;
+
+ List<HttpRequest> httpRequests = new ArrayList<HttpRequest>();
+
+ public SimpleDavServerHandler(final File targetPath )
+ throws Exception
+ {
+ this.siteTargetPath = targetPath;
+ Handler repoHandler = new AbstractHandler()
+ {
+ public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
+ throws IOException, ServletException
+ {
+ String targetPath = request.getPathInfo();
+
+ HttpRequest rq = new HttpRequest();
+ rq.method = request.getMethod();
+ rq.path = targetPath;
+
+ Enumeration headerNames = request.getHeaderNames();
+ while (headerNames.hasMoreElements())
+ {
+ String name = (String) headerNames.nextElement();
+ rq.headers.put( name, request.getHeader( name ) );
+ }
+
+ httpRequests.add( rq );
+
+
+ if ( request.getMethod().equalsIgnoreCase( "PUT" ) )
+ {
+ File targetFile = new File( siteTargetPath, targetPath );
+ log.info( "writing file " + targetFile.getPath() );
+ FileUtils.writeByteArrayToFile( targetFile, IOUtils.toByteArray( request.getInputStream() ) );
+ }
+
+ //PrintWriter writer = response.getWriter();
+
+ response.setStatus( HttpServletResponse.SC_OK );
+
+ ( (Request) request ).setHandled( true );
+ }
+ };
+ server = new Server( 0 );
+ server.setHandler( repoHandler );
+ server.start();
+
+ }
+
+ public SimpleDavServerHandler( Servlet servlet )
+ throws Exception
+ {
+ siteTargetPath = null;
+ server = new Server( 0 );
+ Context context = new Context( server, "/", 0 );
+
+ context.addServlet( new ServletHolder( servlet ), "/" );
+
+ server.start();
+ }
+
+ public int getPort()
+ {
+ return server.getConnectors()[0].getLocalPort();
+ }
+
+ public void stop()
+ throws Exception
+ {
+ server.stop();
+ }
+
+
+ static class HttpRequest
+ {
+ Map<String, String> headers = new HashMap<String,String>();
+
+ String method;
+
+ String path;
+
+ HttpRequest()
+ {
+ // nop
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder( method ).append( " path " ).append( path )
+ .append( SystemUtils.LINE_SEPARATOR );
+ for ( Entry<String, String> entry : headers.entrySet() )
+ {
+ sb.append( entry.getKey() ).append( " : " ).append( entry.getValue() )
+ .append( SystemUtils.LINE_SEPARATOR );
+ }
+ return sb.toString();
+ }
+ }
+}
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java Mon Aug 30 22:22:37 2010
@@ -0,0 +1,47 @@
+package org.apache.maven.plugins.site;
+
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 3.0-beta-2
+ * @version $Id$
+ */
+public class SiteDeployWebDavTest
+ extends AbstractSiteDeployWebDavTest
+{
+
+ @Override
+ String getMojoName()
+ {
+ return "deploy";
+ }
+
+ @Override
+ AbstractMojo getMojo( File pluginXmlFile ) throws Exception
+ {
+ return (SiteDeployMojo) lookupMojo( getMojoName(), pluginXmlFile );
+ }
+
+}
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/stubs/SiteMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/stubs/SiteMavenProjectStub.java?rev=991009&r1=991008&r2=991009&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/stubs/SiteMavenProjectStub.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/stubs/SiteMavenProjectStub.java Mon Aug 30 22:22:37 2010
@@ -22,7 +22,9 @@ package org.apache.maven.plugins.site.st
import java.io.File;
import java.util.Properties;
+import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Model;
+import org.apache.maven.model.Site;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.codehaus.plexus.util.ReaderFactory;
@@ -34,14 +36,21 @@ import org.codehaus.plexus.util.ReaderFa
public class SiteMavenProjectStub
extends MavenProjectStub
{
+ DistributionManagement distributionManagement = new DistributionManagement();
+
public SiteMavenProjectStub()
{
+ this( null );
+ }
+
+ public SiteMavenProjectStub(String pomFilePath)
+ {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model = null;
try
{
- File pomFile = new File( getBasedir(), "/src/test/resources/unit/interpolated-site/pom.xml" );
+ File pomFile = new File( getBasedir(),pomFilePath == null ? "/src/test/resources/unit/interpolated-site/pom.xml" : pomFilePath );
model = pomReader.read( ReaderFactory.newXmlReader( pomFile ) );
setModel( model );
}
@@ -49,6 +58,9 @@ public class SiteMavenProjectStub
{
throw new RuntimeException( e );
}
+ Site site = new Site();
+ site.setId( "localhost" );
+ distributionManagement.setSite( site );
}
/**
@@ -66,4 +78,10 @@ public class SiteMavenProjectStub
{
return new Properties();
}
+
+ @Override
+ public DistributionManagement getDistributionManagement()
+ {
+ return distributionManagement;
+ }
}
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml Mon Aug 30 22:22:37 2010
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugin.site.unit</groupId>
+ <artifactId>interpolatesite</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <inceptionYear>2006</inceptionYear>
+ <name>Interpolatesite</name>
+ <description>Test interpolation for site.xml.</description>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <developers>
+ <developer>
+ <id>vsiveton</id>
+ <name>Vincent Siveton</name>
+ <email>vsiveton@apache.org</email>
+ <organization>Apache Software Foundation</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ <timezone>-5</timezone>
+ </developer>
+ </developers>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0-SNAPSHOT</version>
+ <configuration>
+
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <distributionManagement>
+ <site>
+ <id>foo</id>
+ <name>bar</name>
+ </site>
+ </distributionManagement>
+</project>
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css Mon Aug 30 22:22:37 2010
@@ -0,0 +1,151 @@
+body {
+ margin: 0px;
+ padding: 0px;
+}
+img {
+ border:none;
+}
+table {
+ padding:0px;
+ width: 100%;
+ margin-left: -2px;
+ margin-right: -2px;
+}
+acronym {
+ cursor: help;
+ border-bottom: 1px dotted #feb;
+}
+table.bodyTable th, table.bodyTable td {
+ padding: 2px 4px 2px 4px;
+ vertical-align: top;
+}
+div.clear{
+ clear:both;
+ visibility: hidden;
+}
+div.clear hr{
+ display: none;
+}
+#bannerLeft, #bannerRight {
+ font-size: xx-large;
+ font-weight: bold;
+}
+#bannerLeft img, #bannerRight img {
+ margin: 0px;
+}
+.xleft, #bannerLeft img {
+ float:left;
+}
+.xright, #bannerRight {
+ float:right;
+}
+#banner {
+ padding: 0px;
+}
+#banner img {
+ border: none;
+}
+#breadcrumbs {
+ padding: 3px 10px 3px 10px;
+}
+#leftColumn {
+ width: 170px;
+ float:left;
+ overflow: auto;
+}
+#bodyColumn {
+ margin-right: 1.5em;
+ margin-left: 197px;
+}
+#legend {
+ padding: 8px 0 8px 0;
+}
+#navcolumn {
+ padding: 8px 4px 0 8px;
+}
+#navcolumn h5 {
+ margin: 0;
+ padding: 0;
+ font-size: small;
+}
+#navcolumn ul {
+ margin: 0;
+ padding: 0;
+ font-size: small;
+}
+#navcolumn li {
+ list-style-type: none;
+ background-image: none;
+ background-repeat: no-repeat;
+ background-position: 0 0.4em;
+ padding-left: 16px;
+ list-style-position: outside;
+ line-height: 1.2em;
+ font-size: smaller;
+}
+#navcolumn li.expanded {
+ background-image: url(../images/expanded.gif);
+}
+#navcolumn li.collapsed {
+ background-image: url(../images/collapsed.gif);
+}
+#poweredBy {
+ text-align: center;
+}
+#navcolumn img {
+ margin-top: 10px;
+ margin-bottom: 3px;
+}
+#poweredBy img {
+ display:block;
+ margin: 20px 0 20px 17px;
+}
+#search img {
+ margin: 0px;
+ display: block;
+}
+#search #q, #search #btnG {
+ border: 1px solid #999;
+ margin-bottom:10px;
+}
+#search form {
+ margin: 0px;
+}
+#lastPublished {
+ font-size: x-small;
+}
+.navSection {
+ margin-bottom: 2px;
+ padding: 8px;
+}
+.navSectionHead {
+ font-weight: bold;
+ font-size: x-small;
+}
+.section {
+ padding: 4px;
+}
+#footer {
+ padding: 3px 10px 3px 10px;
+ font-size: x-small;
+}
+#breadcrumbs {
+ font-size: x-small;
+ margin: 0pt;
+}
+.source {
+ padding: 12px;
+ margin: 1em 7px 1em 7px;
+}
+.source pre {
+ margin: 0px;
+ padding: 0px;
+}
+#navcolumn img.imageLink, .imageLink{
+ padding-left: 0px;
+ padding-bottom: 0px;
+ padding-top: 0px;
+ padding-right: 2px;
+ border: 0px;
+ margin: 0px;
+}
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/css/maven-base.css
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html?rev=991009&view=auto
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html (added)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html Mon Aug 30 22:22:37 2010
@@ -0,0 +1,442 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- Generated by Apache Maven Doxia at Aug 7, 2010 -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Maven -
+ Welcome to Apache Maven</title>
+ <style type="text/css" media="all">
+ @import url("./css/maven-base.css");
+ @import url("./css/maven-theme.css");
+ @import url("./css/site.css");
+ </style>
+ <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+ <meta name="author" content="Brett Porter" />
+ <meta name="author" content="Jason van Zyl" />
+ <meta name="Date-Revision-yyyymmdd" content="20100807" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+
+<script type="text/javascript">_uacct = "UA-140879-1";
+ urchinTracker();</script>
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="" id="bannerLeft">
+ <img src="images/apache-maven-project-2.png" alt="" />
+ </a>
+ <span id="bannerRight">
+ <img src="images/maven-logo-2.gif" alt="" />
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+ <div class="xleft">
+ <a href="http://www.apache.org/" class="externalLink">Apache</a>
+ >
+ Maven
+ </div>
+ <div class="xright">
+ Last Published: 2010-08-07
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+ <h5>Main</h5>
+ <ul>
+ <li class="none">
+ <strong>Welcome</strong>
+ </li>
+ </ul>
+ <h5>Get Maven</h5>
+ <ul>
+ <li class="none">
+ <a href="download.html">Download</a>
+ </li>
+ <li class="none">
+ <a href="docs/2.2.1/release-notes.html">Release Notes (2.2.1)</a>
+ </li>
+ <li class="none">
+ <a href="docs/2.0.11/release-notes.html">Release Notes (2.0.11)</a>
+ </li>
+ <li class="none">
+ <a href="license.html">License</a>
+ </li>
+ </ul>
+ <h5>IDE Integration</h5>
+ <ul>
+ <li class="none">
+ <a href="eclipse-plugin.html">Eclipse</a>
+ </li>
+ <li class="none">
+ <a href="netbeans-module.html">Netbeans</a>
+ </li>
+ </ul>
+ <h5>About Maven</h5>
+ <ul>
+ <li class="none">
+ <a href="what-is-maven.html">What is Maven?</a>
+ </li>
+ <li class="none">
+ <a href="maven-features.html">Features</a>
+ </li>
+ <li class="none">
+ <a href="general.html">FAQ (official)</a>
+ </li>
+ <li class="none">
+ <a href="http://docs.codehaus.org/display/MAVENUSER/FAQs-1" class="externalLink">FAQ (unofficial)</a>
+ </li>
+ <li class="none">
+ <a href="powered-by-m2.html">Powered By</a>
+ </li>
+ </ul>
+ <h5>Documentation</h5>
+ <ul>
+ <li class="none">
+ <a href="plugins/index.html">Maven Plugins</a>
+ </li>
+ <li class="none">
+ <a href="guides/index.html">Index (category)</a>
+ </li>
+ <li class="none">
+ <a href="run-maven/index.html">Running Maven</a>
+ </li>
+ <li class="collapsed">
+ <a href="users/index.html">User Centre</a>
+ </li>
+ <li class="collapsed">
+ <a href="plugin-developers/index.html">Plugin Developer Centre</a>
+ </li>
+ <li class="none">
+ <a href="repository/index.html">Maven Repository Centre</a>
+ </li>
+ <li class="none">
+ <a href="developers/index.html">Maven Developer Centre</a>
+ </li>
+ <li class="none">
+ <a href="articles.html">Books and Resources</a>
+ </li>
+ <li class="none">
+ <a href="http://docs.codehaus.org/display/MAVENUSER/Home" class="externalLink">Wiki</a>
+ </li>
+ </ul>
+ <h5>Community</h5>
+ <ul>
+ <li class="none">
+ <a href="community.html">Community Overview</a>
+ </li>
+ <li class="none">
+ <a href="guides/development/guide-helping.html">How to Contribute</a>
+ </li>
+ <li class="none">
+ <a href="guides/mini/guide-maven-evangelism.html">Maven Repository</a>
+ </li>
+ <li class="none">
+ <a href="users/getting-help.html">Getting Help</a>
+ </li>
+ <li class="none">
+ <a href="issue-tracking.html">Issue Tracking</a>
+ </li>
+ <li class="none">
+ <a href="source-repository.html">Source Repository</a>
+ </li>
+ <li class="none">
+ <a href="team-list.html">The Maven Team</a>
+ </li>
+ </ul>
+ <h5>Project Documentation</h5>
+ <ul>
+ <li class="collapsed">
+ <a href="project-info.html">Project Information</a>
+ </li>
+ </ul>
+ <h5>Maven Projects</h5>
+ <ul>
+ <li class="none">
+ <a href="ant-tasks/index.html">Ant Tasks</a>
+ </li>
+ <li class="none">
+ <a href="archetype/index.html">Archetype</a>
+ </li>
+ <li class="none">
+ <a href="doxia/index.html">Doxia</a>
+ </li>
+ <li class="none">
+ <a href="jxr/index.html">JXR</a>
+ </li>
+ <li class="none">
+ <a href="maven-1.x/index.html">Maven 1.x</a>
+ </li>
+ <li class="none">
+ <strong>Maven 2</strong>
+ </li>
+ <li class="none">
+ <a href="mercury/index.html">Mercury</a>
+ </li>
+ <li class="none">
+ <a href="plugins/index.html">Plugins</a>
+ </li>
+ <li class="none">
+ <a href="scm/index.html">SCM</a>
+ </li>
+ <li class="none">
+ <a href="shared/index.html">Shared Components</a>
+ </li>
+ <li class="none">
+ <a href="surefire/index.html">Surefire</a>
+ </li>
+ <li class="none">
+ <a href="wagon/index.html">Wagon</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+ <img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
+ </a>
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <!-- 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. -->
+
+
+ <!-- TODO: news? -->
+ <div class="section"><h2></h2> <!-- valid xdoc needs at least a section -->
+ <div id="downloadbox">
+ <div class="section"><div class="section"><div class="section"><h5>Search Maven Sites<a name="Search_Maven_Sites"></a></h5>
+<!-- Google CSE Search Box Begins -->
+<form action="http://www.google.com/cse" id="searchbox_006660305041243700248:hyqtfwsewpm">
+ <input type="hidden" name="cx" value="006660305041243700248:hyqtfwsewpm" />
+ <input type="text" name="q" size="25" />
+ <input type="submit" name="sa" value="Search" />
+</form>
+<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_006660305041243700248%3Ahyqtfwsewpm"></script>
+<!-- Google CSE Search Box Ends -->
+
+ </div><div class="section"><h5>Get Maven 2.2.1<a name="Get_Maven_2.2.1"></a></h5>
+ <span style="display: block; text-align: right; font-size: smaller">Released: 11 August 2009</span>
+ <p>
+ <a href="download.html">
+ <img src="images/folder-open.gif" border="0" alt="" title="Download Maven 2.2.1" />
+ Maven 2.2.1
+ </a>
+ <span style="font-size: smaller">
+ <br />
+ <a href="docs/2.2.1/release-notes.html">Release Notes</a>,
+ <a href="download.html#Requirements">System Requirements</a>,
+ <a href="download.html#Installation">Installation Instructions</a>
+ </span>
+ </p>
+ </div><div class="section"><h5>Get Maven Ant Tasks<a name="Get_Maven_Ant_Tasks"></a></h5>
+ <span style="display: block; text-align: right; font-size: smaller">Released: 22 Jul 2010</span>
+ <p>
+ <a href="ant-tasks/download.html">
+ <img src="images/folder-open.gif" border="0" alt="" title="Download Maven Tasks for Ant 2.1.1" />
+ Maven Tasks for Ant 2.1.1
+ </a>
+ <span style="font-size: smaller">
+ <br />
+ <a href="ant-tasks/release-notes.html">Release Notes</a>,
+ <a href="ant-tasks/index.html">Documentation</a>
+ </span>
+ </p>
+ </div><div class="section"><h5>Older Release<a name="Older_Release"></a></h5>
+ <span style="display: block; text-align: right; font-size: smaller">Released: 25 Feb 2010</span>
+ <p>
+ <a href="download.html#Maven_2.0.11">
+ <img src="images/folder-open.gif" border="0" alt="" title="Download Maven 2.0.11" />
+ Maven 2.0.11
+ </a>
+ <span style="font-size: smaller">
+ <br />
+ <a href="docs/2.0.11/release-notes.html">Release Notes</a>
+ </span>
+ </p>
+
+ <!-- TODO: we should use the SSI instead, but two things prevent it: a) the SSI's aren't working on apache.org yet so I can't test it; b) SSI's get eliminated from xdoc. For some reason even inside CDATA they are escaped.
+ <iframe src="http://www.apache.org/ads/bannerbar.html" style="margin-left: -13px; margin-top: -3px; padding: 0" frameborder="0" scrolling="no" width="247" height="88"></iframe> -->
+
+ </div><div class="section"><h5>Looking for Artifacts?<a name="Looking_for_Artifacts"></a></h5>
+ <p><a class="externalLink" href="http://repository.sonatype.org">Search Central</a> and other Public Repositories.</p>
+ </div><div class="section"><h5>Looking for Repository Managers?<a name="Looking_for_Repository_Managers"></a></h5>
+ <p><a class="externalLink" href="http://maven.apache.org/repository-management.html">Take a look</a> at the Repository Managers available from the community.</p>
+ </div><div class="section"><h5>Looking for CI Servers?<a name="Looking_for_CI_Servers"></a></h5>
+ <p><a class="externalLink" href="http://maven.apache.org/continuous-integration.html">Take a look</a> at the CI Servers available from the community.</p>
+ </div><div class="section"><h5>Looking for Code Quality Management tools?<a name="Looking_for_Code_Quality_Management_tools"></a></h5>
+ <p><a class="externalLink" href="http://maven.apache.org/code-quality-management.html">Take a look</a> at the Code Quality Management platforms available from the community.</p>
+
+ </div><div class="section"><h5>Supporting Maven<a name="Supporting_Maven"></a></h5>
+ <p>We'd like to <a class="externalLink" href="http://www.apache.org/foundation/thanks.html">thank the sponsors of the Apache Software Foundation</a> for their support and assistance. To support the ASF, see the <a class="externalLink" href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a> page.</p>
+ </div>
+ </div></div></div></div>
+
+ <div class="section"><h2>Welcome to Apache Maven<a name="Welcome_to_Apache_Maven"></a></h2>
+
+ <!-- TODO: I reckon it's time for a new description -->
+ <p>
+ Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model
+ (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
+ </p>
+ <p>
+ If you think that Maven could help your project, you can find out more information about in the "About Maven"
+ section of the navigation. This includes an in-depth description of <a href="what-is-maven.html">what Maven is</a>,
+ a <a href="maven-features.html">list of some of its main features</a>, and a set of <a href="general.html">frequently
+ asked questions about what Maven is</a>.
+ </p>
+ <div class="section"><h3>Learning about Maven<a name="Learning_about_Maven"></a></h3>
+ <p>
+ <!-- TODO: this could be the big button type thing instead of a list of links -->
+ This site is separated into the following sections, depending on how you'd like to use Maven:
+ </p>
+ <!-- TODO: use CSS -->
+ <ul>
+ <li>
+ <span style="white-space:nowrap; font-weight: bold; font-size: 1.25em">
+ <a href="run-maven/index.html">Run Maven</a>
+ </span>
+ <span style="display: block; margin-bottom: 0.5em">
+ Information for those needing to build a project that uses Maven
+ </span>
+ </li>
+ <li>
+ <span style="white-space:nowrap; font-weight: bold; font-size: 1.25em">
+ <a href="users/index.html">Use Maven</a>
+ </span>
+ <span style="display: block; margin-bottom: 0.5em">
+ Information for those wanting to use Maven to build their project, including a "10 minute test" that gives a
+ practical overview of Maven's main features in just 10 minutes
+ </span>
+ </li>
+ <li>
+ <span style="white-space:nowrap; font-weight: bold; font-size: 1.25em">
+ <a href="plugin-developers/index.html">Write Maven Plugins</a>
+ </span>
+ <span style="display: block; margin-bottom: 0.5em">
+ Information for those who may or may not be using Maven, but want to provide a plugin for shared
+ functionality or to accompany their own product or toolset
+ </span>
+ </li>
+ <li>
+ <span style="white-space:nowrap; font-weight: bold; font-size: 1.25em">
+ <a href="repository/index.html">Improve the Maven Repository</a>
+ </span>
+ <span style="display: block; margin-bottom: 0.5em">
+ Information for those who may or may not use, but are interested in getting project metadata into the
+ repository
+ </span>
+ </li>
+ <li>
+ <span style="white-space:nowrap; font-weight: bold; font-size: 1.25em">
+ <a href="developers/index.html">Develop Maven</a>
+ </span>
+ <span style="display: block; margin-bottom: 0.5em">
+ Information for those who are currently developers, or who are interested
+ in contributing to the Maven project itself
+ </span>
+ </li>
+ </ul>
+ <p>
+ Each guide is divided into a number of trails to get you started on a particular topic, and includes a
+ reference area and a "cookbook" of common examples.
+ </p>
+ <p>
+ You can access the guides at any time from the left navigation.
+ </p>
+ </div><div class="section"><h3>Documentation Index<a name="Documentation_Index"></a></h3>
+ <p>
+ If you are looking for a quick reference, you can use the <a href="guides/index.html">documentation index.</a>
+<!-- TODO
+ If you are looking for a quick reference, you can use the documentation index. It is available in both
+ <a href="todo.html">alphabetical</a> and <a href="todo.html">categorical</a> listing formats. -->
+ </p>
+ </div><div class="section"><h3>Plugins<a name="Plugins"></a></h3>
+<!-- TODO
+ <p>
+ Maven functionality is provided by plugins. For an explanation of how plugins work, and basic information on how
+ to use a plugin, see the <a href="todo.html">introduction to plugins</a> in the Users Centre.
+ </p> -->
+ <p>
+ For detailed information on just some of the plugins available for Maven, see the
+ <a href="plugins/index.html">plugin list</a>.
+ </p>
+<!-- TODO: Should these be here, or just in the user centre?
+ <h3>Converting from a different Build System</h3>
+ <p>
+ If you are currently using a different build system, there are options for converting from that to Maven 2
+ either partially or completely. These guides also give an overview of the differences between Maven and the
+ other build system. The following guides are available in the Users Centre:
+ </p>
+ <ul>
+ <li><a href="todo.html">Converting from Ant to Maven 2</a></li>
+ <li><a href="todo.html">Converting from Maven 1.x to Maven 2</a></li>
+ <li><a href="todo.html">Adding Maven 2 to an IDE based build</a></li>
+ </ul> -->
+ </div><div class="section"><h3>How to Get Support<a name="How_to_Get_Support"></a></h3>
+ <p>
+ Support for Maven is available in a variety of different forms.
+ </p>
+ <p>
+ To get started, search the documentation, the <a class="externalLink" href="http://docs.codehaus.org/display/MAVENUSER">wiki</a>,
+ <a href="issue-tracking.html">issue tracker</a>, or the <a href="mail-lists.html">mailing list archives</a> to
+ see if the problem has been solved or reported before.
+ </p>
+ <p>
+ If the problem has not been reported before, the recommended way to get help is to
+ subscribe to the <a href="mail-lists.html">Maven Users Mailing list</a>. Many other users and Maven developers
+ will answer your questions there, and the answer will be archived for others in the future.
+ </p>
+ <p>
+ You can also reach the Maven developers on <a href="community.html">IRC</a>.
+ </p>
+
+ </div><div class="section"><h3>How can I help?<a name="How_can_I_help"></a></h3>
+ <p>
+ Maven is an open source community and welcomes contributions. If you'd like to get involved, see the
+ <a href="guides/development/guide-helping.html">Guide to helping with Maven</a>.
+ </p>
+ <p>
+ Maven is a part of the Apache Software Foundation. We'd like to <a class="externalLink" href="http://www.apache.org/foundation/thanks.html">thank
+ the sponsors</a> that provide financial assistance to the foundation. For more information on how you can support the
+ foundation, see the <a class="externalLink" href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a> page.
+ </p>
+ </div></div>
+
+
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">© 2002-2010
+ The Apache Software Foundation
+
+ - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a></div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/branches/maven-site-plugin-3.x/src/test/resources/unit/deploy-dav/target/site/index.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
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=991009&r1=991008&r2=991009&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 Mon Aug 30 22:22:37 2010
@@ -72,4 +72,10 @@ under the License.
</plugin>
</plugins>
</build>
+ <distributionManagement>
+ <site>
+ <id>foo</id>
+ <name>bar</name>
+ </site>
+ </distributionManagement>
</project>