mirror of https://github.com/apache/archiva.git
Merging in MRM-1084 and adding factory impls with spring config
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-with-new-repoapi@743633 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
commit
89633ad23f
|
@ -64,19 +64,36 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-15</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
<goal>registry-reader</goal>
|
||||
<goal>registry-writer</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>archiva-jpox-registry-reader</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<generatorId>registry-reader</generatorId>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>archiva-jpox-registry-writer</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<generatorId>registry-writer</generatorId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<version>1.2.0</version>
|
||||
<model>src/main/mdo/configuration.mdo</model>
|
||||
<models>
|
||||
<model>src/main/mdo/configuration.mdo</model>
|
||||
</models>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -59,11 +59,12 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-17</version>
|
||||
<configuration>
|
||||
<version>1.0.0</version>
|
||||
<packageWithVersion>false</packageWithVersion>
|
||||
<model>src/main/mdo/archiva-base.xml</model>
|
||||
<models>
|
||||
<model>src/main/mdo/archiva-base.xml</model>
|
||||
</models>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
@ -71,14 +72,26 @@
|
|||
<goals>
|
||||
<goal>java</goal>
|
||||
<goal>xsd</goal>
|
||||
<goal>jpox-jdo-mapping</goal>
|
||||
<goal>jpox-metadata-class</goal>
|
||||
<!--
|
||||
<goal>xpp3-writer</goal>
|
||||
<goal>xpp3-reader</goal>
|
||||
-->
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>archiva-jpox-jdo-mapping</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<generatorId>jpox-jdo-mapping</generatorId>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>archiva-jpox-metadata-class</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<generatorId>jpox-metadata-class</generatorId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -138,6 +151,24 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- stupid hack because jpox/modello is not supported anymore and it has bugs -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>process-sources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<copy file="${project.build.directory}/generated-sources/modello/org/apache/maven/archiva/model/package.jdo" todir="${project.build.outputDirectory}/org/apache/maven/archiva/model/" />
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
|
|
@ -96,8 +96,7 @@
|
|||
-->
|
||||
<!--
|
||||
<class stash.storable="true"
|
||||
jpox.table="REPOSITORIES"
|
||||
jpox.not-persisted-fields="modelEncoding">
|
||||
jpox.table="REPOSITORIES">
|
||||
<name>ArchivaRepositoryModel</name>
|
||||
<version>1.0.0+</version>
|
||||
<fields>
|
||||
|
@ -219,7 +218,6 @@
|
|||
|
||||
<class stash.storable="true"
|
||||
jpox.table="ARTIFACT"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.use-identifiers-as-primary-key="false"
|
||||
jpox.identity-type="application"
|
||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaArtifactModelKey">
|
||||
|
@ -440,7 +438,6 @@
|
|||
</class>
|
||||
<class stash.storable="true"
|
||||
jpox.table="JAVA_ARTIFACT"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.use-identifiers-as-primary-key="false"
|
||||
jpox.identity-type="application"
|
||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaArtifactJavaDetailsKey">
|
||||
|
@ -586,7 +583,6 @@
|
|||
|
||||
<class stash.storable="true"
|
||||
jpox.use-identifiers-as-primary-key="false"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.identity-type="application"
|
||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaRepositoryMetadataKey"
|
||||
jpox.table="REPOSITORY_METADATA">
|
||||
|
@ -772,7 +768,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="REPOSITORY_METADATA_SNAPSHOTS">
|
||||
<name>SnapshotVersion</name>
|
||||
<description>The Snapshot Version</description>
|
||||
|
@ -807,7 +802,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="REPOSITORY_METADATA_PLUGINS">
|
||||
<name>Plugin</name>
|
||||
<description>The Plugin</description>
|
||||
|
@ -855,7 +849,6 @@
|
|||
-->
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="PROJECT_REFERENCE">
|
||||
<name>ProjectReference</name>
|
||||
<description>A reference to another (unversioned) Project</description>
|
||||
|
@ -919,7 +912,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="VERSIONED_REFERENCE">
|
||||
<name>VersionedReference</name>
|
||||
<description>A reference to another Versioned Project</description>
|
||||
|
@ -995,7 +987,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="ARTIFACT_REFERENCE">
|
||||
<name>ArtifactReference</name>
|
||||
<version>1.0.0+</version>
|
||||
|
@ -1215,7 +1206,6 @@
|
|||
|
||||
<class stash.storable="true"
|
||||
jpox.table="PROJECT"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.use-identifiers-as-primary-key="false"
|
||||
jpox.identity-type="application"
|
||||
jpox.identity-class="org.apache.maven.archiva.model.jpox.ArchivaProjectModelKey">
|
||||
|
@ -1532,7 +1522,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="MAILING_LISTS">
|
||||
<name>MailingList</name>
|
||||
<description>A Mailing List</description>
|
||||
|
@ -1590,7 +1579,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="ORGANIZATION">
|
||||
<name>Organization</name>
|
||||
<description>Specifies the organization that produces this project.</description>
|
||||
|
@ -1634,7 +1622,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="LICENSES">
|
||||
<name>License</name>
|
||||
<description><![CDATA[
|
||||
|
@ -1685,7 +1672,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="ISSUE_MANAGEMENT">
|
||||
<name>IssueManagement</name>
|
||||
<description>
|
||||
|
@ -1717,7 +1703,7 @@
|
|||
</codeSegments>
|
||||
</class>
|
||||
|
||||
<class jpox.not-persisted-fields="modelEncoding">
|
||||
<class>
|
||||
<name>CiManagement</name>
|
||||
<version>1.0.0+</version>
|
||||
<fields>
|
||||
|
@ -1748,8 +1734,7 @@
|
|||
</codeSegments>
|
||||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding">
|
||||
<class stash.storable="true">
|
||||
<name>Individual</name>
|
||||
<description>
|
||||
Description of a person who has contributed to the project.
|
||||
|
@ -1853,7 +1838,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="DEPENDENCY">
|
||||
<name>Dependency</name>
|
||||
<version>1.0.0+</version>
|
||||
|
@ -2043,7 +2027,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="EXCLUSIONS">
|
||||
<name>Exclusion</name>
|
||||
<version>1.0.0+</version>
|
||||
|
@ -2074,7 +2057,6 @@
|
|||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="SCM">
|
||||
<name>Scm</name>
|
||||
<version>1.0.0+</version>
|
||||
|
@ -2119,9 +2101,7 @@
|
|||
</codeSegments>
|
||||
</class>
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="PROJECT_REPOSITORIES">
|
||||
<class stash.storable="true" jpox.table="PROJECT_REPOSITORIES">
|
||||
<name>ProjectRepository</name>
|
||||
<version>1.0.0+</version>
|
||||
<fields>
|
||||
|
@ -2204,7 +2184,6 @@
|
|||
-->
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="REPOSITORY_PROBLEMS">
|
||||
<name>RepositoryProblem</name>
|
||||
<version>1.0.0+</version>
|
||||
|
@ -2307,7 +2286,6 @@
|
|||
-->
|
||||
|
||||
<class stash.storable="true"
|
||||
jpox.not-persisted-fields="modelEncoding"
|
||||
jpox.table="REPOSITORY_STATS">
|
||||
<name>RepositoryContentStatistics</name>
|
||||
<version>1.0.0+</version>
|
||||
|
|
|
@ -1112,7 +1112,6 @@ public class MetadataTransferTest
|
|||
m.getPlugins().add( p );
|
||||
}
|
||||
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
@ -1148,7 +1147,6 @@ public class MetadataTransferTest
|
|||
m.getAvailableVersions().addAll( Arrays.asList( expectedVersions ) );
|
||||
}
|
||||
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
@ -1176,7 +1174,6 @@ public class MetadataTransferTest
|
|||
m.setGroupId( metadata.getGroupId() );
|
||||
m.setArtifactId( metadata.getArtifactId() );
|
||||
m.setVersion( metadata.getVersion() );
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
@ -1254,7 +1251,6 @@ public class MetadataTransferTest
|
|||
|
||||
m.setLastUpdated( expectedDate + expectedTime );
|
||||
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
@ -1290,7 +1286,6 @@ public class MetadataTransferTest
|
|||
m.getAvailableVersions().addAll( Arrays.asList( expectedProxyVersions ) );
|
||||
}
|
||||
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
@ -1320,7 +1315,6 @@ public class MetadataTransferTest
|
|||
m.setGroupId( metadata.getGroupId() );
|
||||
m.setArtifactId( metadata.getArtifactId() );
|
||||
m.setVersion( metadata.getVersion() );
|
||||
m.setModelEncoding( null );
|
||||
RepositoryMetadataWriter.write( m, expectedMetadataXml );
|
||||
|
||||
// Compare the file to the actual contents.
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.codehaus.plexus.registry.RegistryListener;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.collections.map.UnmodifiableMap;
|
||||
|
||||
/**
|
||||
* RepositoryContentRequest
|
||||
|
@ -65,6 +66,24 @@ public class RepositoryContentFactory
|
|||
remoteContentMap = new HashMap<String, RemoteRepositoryContent>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an unmodifiable map representing the Managed repositories
|
||||
* @return managedContentMap
|
||||
*/
|
||||
public Map<String, ManagedRepositoryContent> getManagedContentMap()
|
||||
{
|
||||
return UnmodifiableMap.decorate(managedContentMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an unmodifiable map representing the Remote repositories
|
||||
* @return remoteContentMap
|
||||
*/
|
||||
public Map<String, RemoteRepositoryContent> getRemoteContentMap()
|
||||
{
|
||||
return UnmodifiableMap.decorate(remoteContentMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ManagedRepositoryContent object for the repository Id specified.
|
||||
*
|
||||
|
|
|
@ -219,7 +219,6 @@ public class RepositoryMetadataMerge
|
|||
{
|
||||
Plugin clonedPlugin = new Plugin();
|
||||
clonedPlugin.setArtifactId(plugin.getArtifactId());
|
||||
clonedPlugin.setModelEncoding(plugin.getModelEncoding());
|
||||
clonedPlugin.setName(plugin.getName());
|
||||
clonedPlugin.setPrefix(plugin.getPrefix());
|
||||
result.add(plugin);
|
||||
|
|
|
@ -29,5 +29,13 @@
|
|||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-configuration</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package org.apache.archiva.repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import org.apache.archiva.repository.api.interceptor.RepositoryInterceptor;
|
||||
import org.apache.archiva.repository.api.interceptor.RepositoryInterceptorFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
|
||||
public class DefaultRepositoryInterceptorFactory implements RepositoryInterceptorFactory<RepositoryInterceptor>, BeanFactoryAware
|
||||
{
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private final ArrayList<RepositoryInterceptor> repositoryInterceptors;
|
||||
|
||||
private final Class interceptorType;
|
||||
|
||||
public DefaultRepositoryInterceptorFactory(Class interceptorType)
|
||||
{
|
||||
this.interceptorType = interceptorType;
|
||||
this.repositoryInterceptors = new ArrayList<RepositoryInterceptor>();
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
Map beans = beanFactory.getBeansOfType(interceptorType);
|
||||
if (beans != null)
|
||||
{
|
||||
repositoryInterceptors.addAll(repositoryInterceptors);
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<RepositoryInterceptor> getRepositoryInterceptors()
|
||||
{
|
||||
return repositoryInterceptors;
|
||||
}
|
||||
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
|
||||
{
|
||||
if (beanFactory instanceof ListableBeanFactory)
|
||||
{
|
||||
this.beanFactory = (ListableBeanFactory)beanFactory;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException("BeanFactory is not a ListableBeanFactory " + beanFactory.getClass());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package org.apache.archiva.repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import org.apache.archiva.repository.api.RepositoryManager;
|
||||
import org.apache.archiva.repository.api.RepositoryManagerFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
|
||||
public class DefaultRepositoryManagerFactory implements RepositoryManagerFactory, BeanFactoryAware
|
||||
{
|
||||
private ListableBeanFactory beanFactory;
|
||||
|
||||
private final ArrayList<RepositoryManager> repositoryManagers = new ArrayList<RepositoryManager>();
|
||||
|
||||
public void init()
|
||||
{
|
||||
Map beans = beanFactory.getBeansOfType(RepositoryManager.class);
|
||||
if (beans != null)
|
||||
{
|
||||
repositoryManagers.addAll(beans.values());
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<RepositoryManager> getRepositoryManagers()
|
||||
{
|
||||
return repositoryManagers;
|
||||
}
|
||||
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
|
||||
{
|
||||
if (beanFactory instanceof ListableBeanFactory)
|
||||
{
|
||||
this.beanFactory = (ListableBeanFactory)beanFactory;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException("BeanFactory is not a ListableBeanFactory " + beanFactory.getClass());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<bean name="repositoryFactory" class="org.apache.archiva.repository.DefaultRepositoryFactory">
|
||||
<constructor-arg ref="archivaConfiguration"/>
|
||||
</bean>
|
||||
<bean name="systemRepositoryManager" class="org.apache.archiva.repository.DefaultRepositoryManager"/>
|
||||
<bean name="repositoryManagerFactory" class="org.apache.archiva.repository.DefaultRepositoryManagerFactory" init-method="init"/>
|
||||
<bean name="preRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory" init-method="init">
|
||||
<constructor-arg value="org.apache.archiva.repository.api.interceptor.PreRepositoryInterceptor"/>
|
||||
</bean>
|
||||
<bean name="postRepositoryInterceptorFactory" class="org.apache.archiva.repository.DefaultRepositoryInterceptorFactory" init-method="init">
|
||||
<constructor-arg value="org.apache.archiva.repository.api.interceptor.PostRepositoryInterceptor"/>
|
||||
</bean>
|
||||
</beans>
|
|
@ -29,6 +29,10 @@
|
|||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.archiva.web.servlet;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import org.apache.archiva.repository.api.RepositoryContext;
|
||||
import org.apache.archiva.repository.api.RepositoryManager;
|
||||
import org.apache.archiva.repository.api.RepositoryManagerFactory;
|
||||
|
@ -37,28 +38,37 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.apache.archiva.repository.api.ResourceType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
public class RepositoryServlet extends HttpServlet
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(RepositoryServlet.class);
|
||||
|
||||
private final RepositoryInterceptorFactory<PreRepositoryInterceptor> preRepositoryInterceptorFactory;
|
||||
private RepositoryInterceptorFactory<PreRepositoryInterceptor> preRepositoryInterceptorFactory;
|
||||
|
||||
private final RepositoryInterceptorFactory<PostRepositoryInterceptor> postRepositoryInterceptorFactory;
|
||||
private RepositoryInterceptorFactory<PostRepositoryInterceptor> postRepositoryInterceptorFactory;
|
||||
|
||||
private final RepositoryManagerFactory repositoryManagerFactory;
|
||||
private RepositoryManagerFactory repositoryManagerFactory;
|
||||
|
||||
private static final String MKCOL_METHOD = "MKCOL";
|
||||
|
||||
private static final String LAST_MODIFIED = "last-modified";
|
||||
|
||||
public RepositoryServlet( RepositoryInterceptorFactory<PreRepositoryInterceptor> preRepositoryInterceptorFactory,
|
||||
RepositoryInterceptorFactory<PostRepositoryInterceptor> postRepositoryInterceptorFactory,
|
||||
RepositoryManagerFactory repositoryManagerFactory)
|
||||
private static final String REPOSITORY_MANAGER_FACTORY = "repositoryManagerFactoryName";
|
||||
|
||||
private static final String PREREPOSITORY_INTERCEPTOR_FACTORY = "preRepositoryInterceptorFactoryName";
|
||||
|
||||
private static final String POSTREPOSITORY_INTERCEPTOR_FACTORY = "postRepositoryInterceptorFactoryName";
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException
|
||||
{
|
||||
this.preRepositoryInterceptorFactory = preRepositoryInterceptorFactory;
|
||||
this.postRepositoryInterceptorFactory = postRepositoryInterceptorFactory;
|
||||
this.repositoryManagerFactory = repositoryManagerFactory;
|
||||
super.init(config);
|
||||
final ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(config.getServletContext());
|
||||
repositoryManagerFactory = (RepositoryManagerFactory)applicationContext.getBean(config.getInitParameter(REPOSITORY_MANAGER_FACTORY));
|
||||
preRepositoryInterceptorFactory = (RepositoryInterceptorFactory<PreRepositoryInterceptor>)applicationContext.getBean(config.getInitParameter(PREREPOSITORY_INTERCEPTOR_FACTORY));
|
||||
postRepositoryInterceptorFactory = (RepositoryInterceptorFactory<PostRepositoryInterceptor>)applicationContext.getBean(config.getInitParameter(POSTREPOSITORY_INTERCEPTOR_FACTORY));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -100,6 +100,22 @@
|
|||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-xmlrpc-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-webdav</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-servlet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
|
@ -175,14 +191,6 @@
|
|||
<artifactId>redback-common-integrations</artifactId>
|
||||
</dependency>
|
||||
<!-- Other dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-webdav</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-servlet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
-->
|
||||
|
||||
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
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">
|
||||
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 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>
|
||||
|
||||
|
@ -90,10 +87,22 @@
|
|||
<servlet>
|
||||
<servlet-name>RepositoryServlet</servlet-name>
|
||||
<servlet-class>
|
||||
org.apache.maven.archiva.webdav.RepositoryServlet
|
||||
org.apache.archiva.web.servlet.RepositoryServlet
|
||||
</servlet-class>
|
||||
<!-- Loading this on startup so as to take advantage of configuration listeners -->
|
||||
<load-on-startup>1</load-on-startup>
|
||||
<init-param>
|
||||
<param-name>preRepositoryInterceptorFactoryName</param-name>
|
||||
<param-value>preRepositoryInterceptorFactory</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>postRepositoryInterceptorFactoryName</param-name>
|
||||
<param-value>postRepositoryInterceptorFactory</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>repositoryManagerFactoryName</param-name>
|
||||
<param-value>repositoryManagerFactory</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
28
pom.xml
28
pom.xml
|
@ -110,7 +110,22 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-15</version>
|
||||
<version>1.0</version>
|
||||
<configuration>
|
||||
<useJava5>true</useJava5>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-plugin-plexus-registry</artifactId>
|
||||
<version>1.0-alpha-21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
<artifactId>modello-plugin-jpox</artifactId>
|
||||
<version>1.0-alpha-21</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -1000,6 +1015,17 @@
|
|||
</dependency>
|
||||
|
||||
<!-- Transitive versions to manage -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
|
|
Loading…
Reference in New Issue