Moving RepositoryServlet to its new home in archiva-webdav. Thanks to Brett for helping out with the crazy failing tests.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@661174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James William Dumay 2008-05-29 01:49:41 +00:00
parent a145ac1cde
commit 03584684d1
39 changed files with 379 additions and 235 deletions

View File

@ -34,6 +34,7 @@ import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.events.SessionListener; import org.apache.maven.wagon.events.SessionListener;
import org.apache.maven.wagon.events.TransferListener; import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.proxy.ProxyInfoProvider;
import org.apache.maven.wagon.repository.Repository; import org.apache.maven.wagon.repository.Repository;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -126,6 +127,12 @@ public class WagonDelegate
delegate.connect( source, proxyInfo ); delegate.connect( source, proxyInfo );
} }
public void connect( Repository source, ProxyInfoProvider proxyInfoProvider )
throws ConnectionException, AuthenticationException
{
delegate.connect( source, proxyInfoProvider );
}
public void connect( Repository source, AuthenticationInfo authenticationInfo ) public void connect( Repository source, AuthenticationInfo authenticationInfo )
throws ConnectionException, AuthenticationException throws ConnectionException, AuthenticationException
{ {
@ -138,6 +145,12 @@ public class WagonDelegate
delegate.connect( source, authenticationInfo, proxyInfo ); delegate.connect( source, authenticationInfo, proxyInfo );
} }
public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider )
throws ConnectionException, AuthenticationException
{
delegate.connect( source, authenticationInfo, proxyInfoProvider );
}
public void openConnection() public void openConnection()
throws ConnectionException, AuthenticationException throws ConnectionException, AuthenticationException
{ {

View File

@ -233,23 +233,6 @@
<artifactId>activation</artifactId> <artifactId>activation</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Test Scoped -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.codehaus.plexus</groupId> <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-quartz</artifactId> <artifactId>plexus-quartz</artifactId>
@ -264,42 +247,6 @@
<groupId>org.codehaus.plexus</groupId> <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-taskqueue</artifactId> <artifactId>plexus-taskqueue</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-keys-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-rbac-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-users-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>commons-fileupload</groupId> <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId> <artifactId>commons-fileupload</artifactId>

View File

@ -1,72 +0,0 @@
package org.apache.maven.archiva.web.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.maven.archiva.webdav.util.MimeTypes;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import java.io.IOException;
import java.net.URL;
/**
* Custom Archiva MimeTypes loader for plexus-webdav's {@link MimeTypes}
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
* @todo Support custom mime types from archiva-configuration.
*
* @plexus.component role="org.apache.maven.archiva.web.repository.ArchivaMimeTypeLoader"
*/
public class ArchivaMimeTypeLoader
implements Initializable
{
/**
* @plexus.requirement
*/
private MimeTypes mimeTypes;
public void initialize()
throws InitializationException
{
// TODO: Make mime types loading configurable.
// Load the mime types from archiva location.
if ( mimeTypes.getMimeType( "sha1" ) == null )
{
URL url = this.getClass().getClassLoader().getResource( "/archiva-mime-types.txt" );
if ( url == null )
{
url = this.getClass().getClassLoader().getResource( "archiva-mime-types.txt" );
}
if ( url != null )
{
try
{
mimeTypes.load( url.openStream() );
}
catch ( IOException e )
{
throw new InitializationException( "Unable to load archiva-mime-types.txt : " + e.getMessage(), e );
}
}
}
}
}

View File

@ -1,75 +0,0 @@
package org.apache.maven.archiva.web.repository;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.SystemUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
/**
* PolicingServletRequest is for policing the incoming request for naughty bits, such as a double slashes,
* or paths that include "/../" type syntax, or query string. Stripping out all things that are
* not appropriate.
*
* @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
* @version $Id$
*/
public class PolicingServletRequest
extends HttpServletRequestWrapper
implements HttpServletRequest
{
private String fixedPathInfo;
public PolicingServletRequest( HttpServletRequest originalRequest )
{
super( originalRequest );
fixedPathInfo = originalRequest.getPathInfo();
if ( StringUtils.isNotBlank( fixedPathInfo ) )
{
/* Perform a simple security normalization of the requested pathinfo.
* This is to cleanup requests that use "/../" or "///" type hacks.
*/
fixedPathInfo = FilenameUtils.normalize( fixedPathInfo );
if ( SystemUtils.IS_OS_WINDOWS )
{
// Adjust paths back to unix & url format expectations (when on windows)
fixedPathInfo = FilenameUtils.separatorsToUnix( fixedPathInfo );
}
}
}
@Override
public String getPathInfo()
{
return fixedPathInfo;
}
@Override
public String getQueryString()
{
// No query string allowed.
return null;
}
}

View File

@ -81,7 +81,7 @@
<servlet> <servlet>
<servlet-name>RepositoryServlet</servlet-name> <servlet-name>RepositoryServlet</servlet-name>
<servlet-class>org.apache.maven.archiva.web.repository.RepositoryServlet</servlet-class> <servlet-class>org.apache.maven.archiva.webdav.RepositoryServlet</servlet-class>
<!-- Loading this on startup so as to take advantage of configuration listeners --> <!-- Loading this on startup so as to take advantage of configuration listeners -->
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>

View File

@ -111,6 +111,79 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-keys-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-rbac-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus.redback</groupId>
<artifactId>redback-users-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
<!-- Required by it.could classes --> <!-- Required by it.could classes -->

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -23,7 +23,6 @@ import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ConfigurationEvent; import org.apache.maven.archiva.configuration.ConfigurationEvent;
import org.apache.maven.archiva.configuration.ConfigurationListener; import org.apache.maven.archiva.configuration.ConfigurationListener;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.webdav.*;
import org.apache.jackrabbit.webdav.server.AbstractWebdavServlet; import org.apache.jackrabbit.webdav.server.AbstractWebdavServlet;
import org.apache.jackrabbit.webdav.*; import org.apache.jackrabbit.webdav.*;
import org.codehaus.plexus.spring.PlexusToSpringUtils; import org.codehaus.plexus.spring.PlexusToSpringUtils;

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -29,12 +29,15 @@ import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
import org.apache.maven.archiva.webdav.RepositoryServlet;
import org.codehaus.plexus.spring.PlexusInSpringTestCase; import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import junit.framework.Assert;
/** /**
* AbstractRepositoryServletTestCase * AbstractRepositoryServletTestCase
* *
@ -85,13 +88,13 @@ public abstract class AbstractRepositoryServletTestCase
protected void assertResponseOK( WebResponse response ) protected void assertResponseOK( WebResponse response )
{ {
assertNotNull( "Should have recieved a response", response ); assertNotNull( "Should have recieved a response", response );
assertEquals( "Should have been an OK response code.", HttpServletResponse.SC_OK, response.getResponseCode() ); Assert.assertEquals( "Should have been an OK response code.", HttpServletResponse.SC_OK, response.getResponseCode() );
} }
protected void assertResponseNotFound( WebResponse response ) protected void assertResponseNotFound( WebResponse response )
{ {
assertNotNull( "Should have recieved a response", response ); assertNotNull( "Should have recieved a response", response );
assertEquals( "Should have been an 404/Not Found response code.", HttpServletResponse.SC_NOT_FOUND, response Assert.assertEquals( "Should have been an 404/Not Found response code.", HttpServletResponse.SC_NOT_FOUND, response
.getResponseCode() ); .getResponseCode() );
} }
@ -165,7 +168,7 @@ public abstract class AbstractRepositoryServletTestCase
HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); HttpUnitOptions.setExceptionsThrownOnErrorStatus( false );
sr = new ServletRunner( getTestFile( "src/test/webapp/WEB-INF/web.xml" ) ); sr = new ServletRunner( getTestFile( "src/test/resources/WEB-INF/web.xml" ) );
sr.registerServlet( "/repository/*", UnauthenticatedRepositoryServlet.class.getName() ); sr.registerServlet( "/repository/*", UnauthenticatedRepositoryServlet.class.getName() );
sc = sr.newClient(); sc = sr.newClient();
} }
@ -173,7 +176,7 @@ public abstract class AbstractRepositoryServletTestCase
@Override @Override
protected String getPlexusConfigLocation() protected String getPlexusConfigLocation()
{ {
return "org/apache/maven/archiva/web/repository/RepositoryServletTest.xml"; return "org/apache/maven/archiva/webdav/RepositoryServletTest.xml";
} }
@Override @Override
@ -190,6 +193,11 @@ public abstract class AbstractRepositoryServletTestCase
sr.shutDown(); sr.shutDown();
} }
if (repoRootInternal.exists())
{
FileUtils.deleteDirectory(repoRootInternal);
}
super.tearDown(); super.tearDown();
} }

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/** /**
* RepositoryServletSecurityTest * RepositoryServletSecurityTest

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -22,10 +22,9 @@ package org.apache.maven.archiva.web.repository;
import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.webdav.RepositoryServlet;
import com.meterware.httpunit.GetMethodWebRequest; import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.HttpNotFoundException;
import com.meterware.httpunit.HttpUnitOptions;
import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.WebResponse;

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one

View File

@ -1,4 +1,4 @@
package org.apache.maven.archiva.web.repository; package org.apache.maven.archiva.webdav;
/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
@ -21,6 +21,7 @@ package org.apache.maven.archiva.web.repository;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.context.support.WebApplicationContextUtils;
import org.apache.maven.archiva.webdav.RepositoryServlet;
import javax.servlet.ServletConfig; import javax.servlet.ServletConfig;

View File

@ -0,0 +1,33 @@
<?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.
-->
<component-set>
<components>
<!-- Components that are common for all test cases -->
<component>
<role>org.apache.maven.archiva.webdav.util.MimeTypes</role>
<implementation>org.apache.maven.archiva.webdav.util.MimeTypes</implementation>
<description>MimeTypes</description>
<configuration>
<resource>archiva-mime-types.txt</resource>
</configuration>
</component>
</components>
</component-set>

View File

@ -0,0 +1,45 @@
<?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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Apache Archiva</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextClass</param-name>
<param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/META-INF/plexus/components.xml
classpath*:/META-INF/spring-context.xml
target/test-classes/org/apache/maven/archiva/webdav/RepositoryServletTest.xml
</param-value>
</context-param>
</web-app>

View File

@ -0,0 +1 @@
artifact.jar

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p|%t|%5r|%-30c{1} - %m%n"/>
</layout>
</appender>
<!-- Help identify bugs during testing -->
<logger name="org.apache.maven.archiva">
<level value="info"/>
</logger>
<logger name="net.sf.ehcache">
<level value="warn"/>
</logger>
<logger name="org.codehaus.plexus.security">
<level value="info"/>
</logger>
<logger name="org.springframework">
<level value="error"/>
</logger>
<logger name="org.codehaus.plexus.spring">
<level value="error"/>
</logger>
<logger name="JPOX">
<level value="warn"/>
</logger>
<logger name="JPOX.MetaData">
<level value="error"/>
</logger>
<logger name="JPOX.RDBMS.SQL">
<level value="error"/>
</logger>
<logger name="SQL">
<level value="error"/>
</logger>
<root>
<priority value ="info" />
<appender-ref ref="console" />
</root>
</log4j:configuration>

View File

@ -102,18 +102,18 @@
<component> <component>
<role>org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers</role> <role>org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers</role>
<role-hint>default</role-hint> <role-hint>default</role-hint>
<implementation>org.apache.maven.archiva.web.repository.StubRepositoryContentConsumers</implementation> <implementation>org.apache.maven.archiva.webdav.StubRepositoryContentConsumers</implementation>
</component> </component>
<component> <component>
<role>org.codehaus.plexus.redback.system.SecuritySystem</role> <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
<role-hint>default</role-hint> <role-hint>default</role-hint>
<implementation>org.apache.maven.archiva.web.repository.BypassSecuritySystem</implementation> <implementation>org.apache.maven.archiva.webdav.BypassSecuritySystem</implementation>
</component> </component>
<component> <component>
<role>org.apache.maven.archiva.webdav.ArchivaDavResourceFactory</role> <role>org.apache.maven.archiva.webdav.ArchivaDavResourceFactory</role>
<implementation>org.apache.maven.archiva.web.repository.UnauthenticatedDavResourceFactory</implementation> <implementation>org.apache.maven.archiva.webdav.UnauthenticatedDavResourceFactory</implementation>
<requirements> <requirements>
<requirement> <requirement>
<role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role> <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>

View File

@ -0,0 +1,111 @@
<?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.
-->
<configuration>
<version>2</version>
<repositoryScanning>
<fileTypes>
<fileType>
<id>artifacts</id>
<patterns>
<pattern>**/*.pom</pattern>
<pattern>**/*.jar</pattern>
<pattern>**/*.ear</pattern>
<pattern>**/*.war</pattern>
<pattern>**/*.car</pattern>
<pattern>**/*.sar</pattern>
<pattern>**/*.mar</pattern>
<pattern>**/*.rar</pattern>
<pattern>**/*.dtd</pattern>
<pattern>**/*.tld</pattern>
<pattern>**/*.tar.gz</pattern>
<pattern>**/*.tar.bz2</pattern>
<pattern>**/*.zip</pattern>
</patterns>
</fileType>
<fileType>
<id>indexable-content</id>
<patterns>
<pattern>**/*.txt</pattern>
<pattern>**/*.TXT</pattern>
<pattern>**/*.block</pattern>
<pattern>**/*.config</pattern>
<pattern>**/*.pom</pattern>
<pattern>**/*.xml</pattern>
<pattern>**/*.xsd</pattern>
<pattern>**/*.dtd</pattern>
<pattern>**/*.tld</pattern>
</patterns>
</fileType>
<fileType>
<id>auto-remove</id>
<patterns>
<pattern>**/*.bak</pattern>
<pattern>**/*~</pattern>
<pattern>**/*-</pattern>
</patterns>
</fileType>
<fileType>
<id>ignored</id>
<patterns>
<pattern>**/.htaccess</pattern>
<pattern>**/KEYS</pattern>
<pattern>**/*.rb</pattern>
<pattern>**/*.sh</pattern>
<pattern>**/.svn/**</pattern>
<pattern>**/.DAV/**</pattern>
</patterns>
</fileType>
</fileTypes>
<knownContentConsumers>
<knownContentConsumer>update-db-artifact</knownContentConsumer>
<knownContentConsumer>create-missing-checksums</knownContentConsumer>
<knownContentConsumer>update-db-repository-metadata</knownContentConsumer>
<knownContentConsumer>validate-checksum</knownContentConsumer>
<knownContentConsumer>validate-signature</knownContentConsumer>
<knownContentConsumer>index-content</knownContentConsumer>
<knownContentConsumer>auto-remove</knownContentConsumer>
<knownContentConsumer>auto-rename</knownContentConsumer>
</knownContentConsumers>
<invalidContentConsumers>
<invalidContentConsumer>update-db-bad-content</invalidContentConsumer>
</invalidContentConsumers>
</repositoryScanning>
<databaseScanning>
<cronExpression>0 0 * * * ?</cronExpression>
<unprocessedConsumers>
<unprocessedConsumer>index-artifact</unprocessedConsumer>
<unprocessedConsumer>update-db-project</unprocessedConsumer>
<unprocessedConsumer>validate-repository-metadata</unprocessedConsumer>
<unprocessedConsumer>index-archive-toc</unprocessedConsumer>
<unprocessedConsumer>update-db-bytecode-stats</unprocessedConsumer>
<unprocessedConsumer>index-public-methods</unprocessedConsumer>
</unprocessedConsumers>
<cleanupConsumers>
<cleanupConsumer>not-present-remove-db-artifact</cleanupConsumer>
<cleanupConsumer>not-present-remove-db-project</cleanupConsumer>
<cleanupConsumer>not-present-remove-indexed</cleanupConsumer>
</cleanupConsumers>
</databaseScanning>
</configuration>

View File

@ -184,6 +184,12 @@
<version>3.8.1</version> <version>3.8.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.6.2</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>easymock</groupId> <groupId>easymock</groupId>
<artifactId>easymock</artifactId> <artifactId>easymock</artifactId>