<groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-scanner</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-dependency-tree-consumer</artifactId>
- <version>1.4-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-metadata-consumer</artifactId>
<artifactId>cli</artifactId>
<version>7</version>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
+ <scope>compile</scope>
+ </dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<!-- test dependencies -->
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </dependency>
<dependency>
<groupId>org.codehaus.redback.components.registry</groupId>
<artifactId>spring-registry-api</artifactId>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </dependency>
<dependency>
<groupId>org.codehaus.redback.components.registry</groupId>
<artifactId>spring-registry-api</artifactId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-i18n</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-common</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<artifactId>archiva-proxy</artifactId>
<name>Archiva Base :: Proxy</name>
<dependencies>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-configuration</artifactId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.redback.components.registry</groupId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<plugins>
<artifactId>archiva-rss</artifactId>
<name>Archiva Web :: RSS</name>
<dependencies>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>metadata-repository-api</artifactId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
<scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </dependency>
<!-- Plexus Security Dependencies -->
<dependency>
<groupId>org.codehaus.redback</groupId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-quartz</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.redback.components</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- use spring for the unit tests?
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
- -->
<dependency>
<groupId>org.codehaus.redback</groupId>
<artifactId>redback-authorization-rbac</artifactId>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<artifactId>metadata-repository-api</artifactId>
<name>Archiva Metadata Repository API</name>
<dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>metadata-model</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<plugins>
import org.apache.archiva.repository.events.RepositoryListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Default implementation of the metadata resolver API. At present it will handle updating the content repository
* from new or changed information in the model and artifacts from the repository storage.
- *
+ * <p/>
* This is a singleton component to allow an alternate implementation to be provided. It is intended to be the same
* system-wide for the whole content repository instead of on a per-managed-repository basis. Therefore, the session is
* passed in as an argument to obtain any necessary resources, rather than the class being instantiated within the
* session in the context of a single managed repository's resolution needs.
- *
+ * <p/>
* Note that the caller is responsible for the session, such as closing and saving (which is implied by the resolver
* being obtained from within the session). The {@link RepositorySession#markDirty()} method is used as a hint to ensure
* that the session knows we've made changes at close. We cannot ensure the changes will be persisted if the caller
* chooses to revert first. This is preferable to storing the metadata immediately - a separate session would require
* having a bi-directional link with the session factory, and saving the existing session might save other changes
* unknowingly by the caller.
- *
- * @plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver"
+ * <p/>
+ * plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver"
*/
+@Service( "metadataResolver#default" )
public class DefaultMetadataResolver
implements MetadataResolver
{
+
+ private Logger log = LoggerFactory.getLogger( DefaultMetadataResolver.class );
+
/**
* FIXME: this needs to be configurable based on storage type - and could also be instantiated per repo. Change to a
* factory, and perhaps retrieve from the session. We should avoid creating one per request, however.
- *
+ * <p/>
* TODO: Also need to accommodate availability of proxy module
* ... could be a different type since we need methods to modify the storage metadata, which would also allow more
* appropriate methods to pass in the already determined repository configuration, for example, instead of the ID
*
* @plexus.requirement role-hint="maven2"
*/
+ @Inject
+ @Named( value = "repositoryStorage#maven2" )
private RepositoryStorage repositoryStorage;
/**
- * @plexus.requirement role="org.apache.archiva.repository.events.RepositoryListener"
+ * plexus.requirement role="org.apache.archiva.repository.events.RepositoryListener"
*/
private List<RepositoryListener> listeners;
- private static final Logger log = LoggerFactory.getLogger( DefaultMetadataResolver.class );
+
+ @Inject
+ private ApplicationContext applicationContext;
+
+ @PostConstruct
+ private void initialize()
+ {
+ listeners =
+ new ArrayList<RepositoryListener>( applicationContext.getBeansOfType( RepositoryListener.class ).values() );
+ }
public ProjectVersionMetadata resolveProjectVersion( RepositorySession session, String repoId, String namespace,
String projectId, String projectVersion )
{
MetadataRepository metadataRepository = session.getRepository();
- ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId,
- projectVersion );
+ ProjectVersionMetadata metadata =
+ metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
// TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated)
// in such cases we might also remove/update stale metadata, including adjusting plugin-based facets
// This would also be better than checking for completeness - we can then refresh only when fixed (though
{
MetadataRepository metadataRepository = session.getRepository();
Collection<String> namespaces = metadataRepository.getRootNamespaces( repoId );
- Collection<String> storageNamespaces = repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>(
- namespaces ) );
+ Collection<String> storageNamespaces =
+ repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>( namespaces ) );
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
{
if ( log.isDebugEnabled() )
Collection<String> namespaces = metadataRepository.getNamespaces( repoId, namespace );
Collection<String> exclusions = new ArrayList<String>( namespaces );
exclusions.addAll( metadataRepository.getProjects( repoId, namespace ) );
- Collection<String> storageNamespaces = repositoryStorage.listNamespaces( repoId, namespace,
- new ExcludesFilter<String>(
- exclusions ) );
+ Collection<String> storageNamespaces =
+ repositoryStorage.listNamespaces( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
{
if ( log.isDebugEnabled() )
Collection<String> projects = metadataRepository.getProjects( repoId, namespace );
Collection<String> exclusions = new ArrayList<String>( projects );
exclusions.addAll( metadataRepository.getNamespaces( repoId, namespace ) );
- Collection<String> storageProjects = repositoryStorage.listProjects( repoId, namespace,
- new ExcludesFilter<String>( exclusions ) );
+ Collection<String> storageProjects =
+ repositoryStorage.listProjects( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
if ( storageProjects != null && !storageProjects.isEmpty() )
{
if ( log.isDebugEnabled() )
{
try
{
- ProjectVersionMetadata versionMetadata = repositoryStorage.readProjectVersionMetadata( repoId,
- namespace,
- projectId,
- projectVersion );
+ ProjectVersionMetadata versionMetadata =
+ repositoryStorage.readProjectVersionMetadata( repoId, namespace, projectId, projectVersion );
for ( RepositoryListener listener : listeners )
{
listener.addArtifact( session, repoId, namespace, projectId, versionMetadata );
}
catch ( RepositoryStorageMetadataInvalidException e )
{
- log.warn( "Not update project in metadata repository due to an error resolving it from storage: " +
- e.getMessage() );
+ log.warn( "Not update project in metadata repository due to an error resolving it from storage: "
+ + e.getMessage() );
for ( RepositoryListener listener : listeners )
{
throws MetadataResolutionException
{
MetadataRepository metadataRepository = session.getRepository();
- Collection<ArtifactMetadata> artifacts = metadataRepository.getArtifacts( repoId, namespace, projectId,
- projectVersion );
+ Collection<ArtifactMetadata> artifacts =
+ metadataRepository.getArtifacts( repoId, namespace, projectId, projectVersion );
ExcludesFilter<String> filter = new ExcludesFilter<String>( createArtifactIdList( artifacts ) );
- Collection<ArtifactMetadata> storageArtifacts = repositoryStorage.readArtifactsMetadata( repoId, namespace,
- projectId,
- projectVersion,
- filter );
+ Collection<ArtifactMetadata> storageArtifacts =
+ repositoryStorage.readArtifactsMetadata( repoId, namespace, projectId, projectVersion, filter );
if ( storageArtifacts != null && !storageArtifacts.isEmpty() )
{
if ( log.isDebugEnabled() )
--- /dev/null
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ default-lazy-init="true">
+
+ <context:annotation-config/>
+ <context:component-scan base-package="org.apache.archiva.metadata.repository"/>
+
+
+</beans>
\ No newline at end of file
* under the License.
*/
+import junit.framework.TestCase;
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.model.CiManagement;
import org.apache.archiva.metadata.model.Dependency;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.Scm;
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
public abstract class AbstractMetadataRepositoryTest
- extends PlexusInSpringTestCase
+ extends TestCase
{
protected static final String OTHER_REPO_ID = "other-repo";
<artifactId>metadata-repository-api</artifactId>
</dependency>
<dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guice</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
- <version>3.0-alpha-4</version>
+ <version>3.0.3</version>
</dependency>
</dependencies>
</dependencyManagement>
* under the License.
*/
+import org.springframework.stereotype.Service;
+
import java.util.HashMap;
import java.util.Map;
/**
- * @plexus.component role="org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider" role-hint="default"
+ * plexus.component role="org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider" role-hint="default"
*/
+@Service( "artifactMappingProvider#default" )
public class DefaultArtifactMappingProvider
implements ArtifactMappingProvider
{
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
import org.apache.maven.archiva.common.utils.VersionUtil;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
import java.io.File;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
- * @plexus.component role="org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator" role-hint="maven2"
+ * plexus.component role="org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator" role-hint="maven2"
*/
+@Service( "repositoryPathTranslator#maven2" )
public class Maven2RepositoryPathTranslator
implements RepositoryPathTranslator
{
private static final Pattern TIMESTAMP_PATTERN = Pattern.compile( "([0-9]{8}.[0-9]{6})-([0-9]+).*" );
+ @Inject
+ private ApplicationContext applicationContext;
+
/**
- * @plexus.requirement role="org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider"
+ * plexus.requirement role="org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider"
+ * see #initialize
*/
private List<ArtifactMappingProvider> artifactMappingProviders;
public Maven2RepositoryPathTranslator()
{
+ // noop
+ }
+
+ @PostConstruct
+ public void initialize()
+ {
+ artifactMappingProviders = new ArrayList<ArtifactMappingProvider>(
+ applicationContext.getBeansOfType( ArtifactMappingProvider.class ).values() );
+
}
+
public Maven2RepositoryPathTranslator( List<ArtifactMappingProvider> artifactMappingProviders )
{
this.artifactMappingProviders = artifactMappingProviders;
{
if ( !id.startsWith( projectId + "-" ) )
{
- throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id +
- "' doesn't start with artifact ID '" + projectId + "'" );
+ throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
+ + "' doesn't start with artifact ID '" + projectId + "'" );
}
MavenArtifactFacet facet = new MavenArtifactFacet();
}
catch ( IllegalStateException e )
{
- throw new IllegalArgumentException(
- "Not a valid artifact path in a Maven 2 repository, filename '" + id +
- "' doesn't contain a timestamped version matching snapshot '" + projectVersion + "'" );
+ throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
+ + "' doesn't contain a timestamped version matching snapshot '"
+ + projectVersion + "'" );
}
}
else
{
// invalid
throw new IllegalArgumentException(
- "Not a valid artifact path in a Maven 2 repository, filename '" + id + "' doesn't contain version '" +
- projectVersion + "'" );
+ "Not a valid artifact path in a Maven 2 repository, filename '" + id + "' doesn't contain version '"
+ + projectVersion + "'" );
}
String classifier;
}
else
{
- throw new IllegalArgumentException(
- "Not a valid artifact path in a Maven 2 repository, filename '" + id +
- "' expected classifier or extension but got '" + id.substring( index ) + "'" );
+ throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
+ + "' expected classifier or extension but got '"
+ + id.substring( index ) + "'" );
}
}
import org.apache.maven.model.Model;
import org.apache.maven.model.Organization;
import org.apache.maven.model.Scm;
+import org.apache.maven.model.building.DefaultModelBuilder;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuilder;
import org.apache.maven.model.building.ModelBuildingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
* The session is passed in as an argument to obtain any necessary resources, rather than the class being instantiated
* within the session in the context of a single managed repository's resolution needs.
*
- * @plexus.component role="org.apache.archiva.metadata.repository.storage.RepositoryStorage" role-hint="maven2"
+ * plexus.component role="org.apache.archiva.metadata.repository.storage.RepositoryStorage" role-hint="maven2"
*/
public class Maven2RepositoryStorage
implements RepositoryStorage
/**
* @plexus.requirement
*/
- private ModelBuilder builder;
+ private ModelBuilder builders;
/**
- * @plexus.requirement
+ * plexus.requirement
*/
+ @Inject @Named(value = "archivaConfiguration#default")
private ArchivaConfiguration archivaConfiguration;
/**
- * @plexus.requirement role-hint="maven2"
+ * plexus.requirement role-hint="maven2"
*/
+ @Inject @Named(value = "repositoryPathTranslator#maven2")
private RepositoryPathTranslator pathTranslator;
private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
private static final String METADATA_FILENAME = "maven-metadata.xml";
+ @PostConstruct
+ public void initialize()
+ {
+ //
+ ou ou
+ }
+
public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
{
// TODO: could natively implement the "shared model" concept from the browse action to avoid needing it there?
--- /dev/null
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+ default-lazy-init="true">
+
+ <context:annotation-config/>
+ <context:component-scan base-package="org.apache.archiva.dependency.tree.maven2,org.apache.archiva.metadata.repository.storage.maven2"/>
+
+</beans>
\ No newline at end of file
<artifactId>commons-logging-api</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- </dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-consumer-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<groupId>org.apache.archiva</groupId>
<artifactId>maven2-repository</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<exclude>org.codehaus.plexus:plexus-log4j-logging</exclude>
<exclude>org.codehaus.plexus:plexus-spring</exclude>
- <!--
<exclude>org.codehaus.redback:plexus-spring</exclude>
- -->
<exclude>commons-logging:commons-logging</exclude>
<exclude>org.slf4j:jcl104-over-slf4j</exclude>
<exclude>velocity:velocity-dep</exclude>
<exclude>ant:ant-optional</exclude>
<exclude>xom:xom</exclude>
<exclude>org.codehaus.plexus:plexus-xwork-integration</exclude>
+ <exclude>org.codehaus.plexus:plexus-component-api</exclude>
+ <exclude>org.codehaus.plexus:plexus-container-default</exclude>
<exclude>plexus:plexus-utils</exclude>
<exclude>com.google.code.atinject:atinject</exclude>
<exclude>org.codehaus.plexus.cache:plexus-cache-api</exclude>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
</dependencies>
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<artifactId>spring-utils</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
+
+ <!--
+ use this layer as some modules need to use maven apis
+ until we find a better solution
+ -->
+
<dependency>
- <groupId>org.codehaus.redback.components</groupId>
- <artifactId>plexus-spring</artifactId>
- <version>1.3-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guice</artifactId>
+ <version>3.0.1</version>
</dependency>
+
+
<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<artifactId>maven-model-builder</artifactId>
<version>${maven3x.version}</version>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- <version>1.0-alpha-22</version>
- </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
<properties>
<struts.version>2.1.8.1</struts.version>
<maven.version>2.0.8</maven.version>
- <maven3x.version>3.0-alpha-4</maven3x.version>
+ <maven3x.version>3.0.3</maven3x.version>
<wagon.version>1.0-beta-5</wagon.version>
<redback.version>1.3-SNAPSHOT</redback.version>
<jetty.version>6.1.19</jetty.version>