mirror of https://github.com/apache/archiva.git
[MRM-1473] remove use of plexus-spring
remove all dependencies to plexus-container use of sisu-inject-plexus (version 2.2.2 with ASL license) for components using maven api components. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1128075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
16714e5e4d
commit
1788eb54c4
|
@ -32,12 +32,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-repository-scanner</artifactId>
|
<artifactId>archiva-repository-scanner</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.archiva</groupId>
|
|
||||||
<artifactId>archiva-dependency-tree-consumer</artifactId>
|
|
||||||
<version>1.4-SNAPSHOT</version>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-metadata-consumer</artifactId>
|
<artifactId>archiva-metadata-consumer</artifactId>
|
||||||
|
@ -64,10 +58,6 @@
|
||||||
<artifactId>cli</artifactId>
|
<artifactId>cli</artifactId>
|
||||||
<version>7</version>
|
<version>7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
|
|
@ -33,11 +33,6 @@
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-repository-metadata</artifactId>
|
<artifactId>maven-repository-metadata</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
|
|
@ -46,20 +46,16 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>xalan</groupId>
|
<groupId>xalan</groupId>
|
||||||
<artifactId>xalan</artifactId>
|
<artifactId>xalan</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>2.7.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sonatype.sisu</groupId>
|
||||||
|
<artifactId>sisu-inject-plexus</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dom4j</groupId>
|
<groupId>dom4j</groupId>
|
||||||
<artifactId>dom4j</artifactId>
|
<artifactId>dom4j</artifactId>
|
||||||
|
|
|
@ -55,14 +55,15 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-digest</artifactId>
|
<artifactId>plexus-digest</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-component-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -50,10 +50,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-component-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components.registry</groupId>
|
<groupId>org.codehaus.redback.components.registry</groupId>
|
||||||
<artifactId>spring-registry-api</artifactId>
|
<artifactId>spring-registry-api</artifactId>
|
||||||
|
@ -74,11 +70,6 @@
|
||||||
<groupId>javax.inject</groupId>
|
<groupId>javax.inject</groupId>
|
||||||
<artifactId>javax.inject</artifactId>
|
<artifactId>javax.inject</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -53,10 +53,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-component-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components.registry</groupId>
|
<groupId>org.codehaus.redback.components.registry</groupId>
|
||||||
<artifactId>spring-registry-api</artifactId>
|
<artifactId>spring-registry-api</artifactId>
|
||||||
|
|
|
@ -48,11 +48,6 @@
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-i18n</artifactId>
|
<artifactId>plexus-i18n</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -40,11 +40,6 @@
|
||||||
<groupId>org.apache.lucene</groupId>
|
<groupId>org.apache.lucene</groupId>
|
||||||
<artifactId>lucene-queries</artifactId>
|
<artifactId>lucene-queries</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-utils</artifactId>
|
<artifactId>plexus-utils</artifactId>
|
||||||
|
@ -52,6 +47,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-digest</artifactId>
|
<artifactId>plexus-digest</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-component-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-lang</groupId>
|
<groupId>commons-lang</groupId>
|
||||||
|
|
|
@ -40,11 +40,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-common</artifactId>
|
<artifactId>archiva-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -28,11 +28,6 @@
|
||||||
<artifactId>archiva-proxy</artifactId>
|
<artifactId>archiva-proxy</artifactId>
|
||||||
<name>Archiva Base :: Proxy</name>
|
<name>Archiva Base :: Proxy</name>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-configuration</artifactId>
|
<artifactId>archiva-configuration</artifactId>
|
||||||
|
@ -65,10 +60,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-digest</artifactId>
|
<artifactId>plexus-digest</artifactId>
|
||||||
</dependency>
|
<exclusions>
|
||||||
<dependency>
|
<exclusion>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-component-api</artifactId>
|
<artifactId>plexus-component-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components.registry</groupId>
|
<groupId>org.codehaus.redback.components.registry</groupId>
|
||||||
|
|
|
@ -35,20 +35,17 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-digest</artifactId>
|
<artifactId>plexus-digest</artifactId>
|
||||||
</dependency>
|
<exclusions>
|
||||||
<dependency>
|
<exclusion>
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-spring</artifactId>
|
<artifactId>plexus-component-api</artifactId>
|
||||||
<scope>test</scope>
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-utils</artifactId>
|
<artifactId>plexus-utils</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-component-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -35,11 +35,6 @@
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -28,11 +28,6 @@
|
||||||
<artifactId>archiva-rss</artifactId>
|
<artifactId>archiva-rss</artifactId>
|
||||||
<name>Archiva Web :: RSS</name>
|
<name>Archiva Web :: RSS</name>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>metadata-repository-api</artifactId>
|
<artifactId>metadata-repository-api</artifactId>
|
||||||
|
|
|
@ -140,6 +140,12 @@
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-slf4j-logging</artifactId>
|
<artifactId>plexus-slf4j-logging</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-component-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
|
@ -191,10 +197,6 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-component-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- Plexus Security Dependencies -->
|
<!-- Plexus Security Dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback</groupId>
|
<groupId>org.codehaus.redback</groupId>
|
||||||
|
@ -241,6 +243,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-quartz</artifactId>
|
<artifactId>plexus-quartz</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-component-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
<groupId>org.codehaus.redback.components</groupId>
|
||||||
|
|
|
@ -80,10 +80,6 @@
|
||||||
<artifactId>servlet-api</artifactId>
|
<artifactId>servlet-api</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-model</artifactId>
|
<artifactId>maven-model</artifactId>
|
||||||
|
|
|
@ -50,18 +50,11 @@
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- use spring for the unit tests?
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-test</artifactId>
|
<artifactId>spring-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback</groupId>
|
<groupId>org.codehaus.redback</groupId>
|
||||||
<artifactId>redback-authorization-rbac</artifactId>
|
<artifactId>redback-authorization-rbac</artifactId>
|
||||||
|
|
|
@ -79,11 +79,6 @@
|
||||||
<groupId>commons-validator</groupId>
|
<groupId>commons-validator</groupId>
|
||||||
<artifactId>commons-validator</artifactId>
|
<artifactId>commons-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -26,6 +26,14 @@
|
||||||
<artifactId>metadata-repository-api</artifactId>
|
<artifactId>metadata-repository-api</artifactId>
|
||||||
<name>Archiva Metadata Repository API</name>
|
<name>Archiva Metadata Repository API</name>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.inject</groupId>
|
||||||
|
<artifactId>javax.inject</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>metadata-model</artifactId>
|
<artifactId>metadata-model</artifactId>
|
||||||
|
@ -34,11 +42,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -30,7 +30,12 @@ import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataN
|
||||||
import org.apache.archiva.repository.events.RepositoryListener;
|
import org.apache.archiva.repository.events.RepositoryListener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
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.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -38,42 +43,57 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* Default implementation of the metadata resolver API. At present it will handle updating the content repository
|
* 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.
|
* 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
|
* 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
|
* 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
|
* 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.
|
* 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
|
* 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
|
* 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
|
* 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
|
* 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
|
* having a bi-directional link with the session factory, and saving the existing session might save other changes
|
||||||
* unknowingly by the caller.
|
* unknowingly by the caller.
|
||||||
*
|
* <p/>
|
||||||
* @plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver"
|
* plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver"
|
||||||
*/
|
*/
|
||||||
|
@Service( "metadataResolver#default" )
|
||||||
public class DefaultMetadataResolver
|
public class DefaultMetadataResolver
|
||||||
implements MetadataResolver
|
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
|
* 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.
|
* 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
|
* 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
|
* ... 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
|
* appropriate methods to pass in the already determined repository configuration, for example, instead of the ID
|
||||||
*
|
*
|
||||||
* @plexus.requirement role-hint="maven2"
|
* @plexus.requirement role-hint="maven2"
|
||||||
*/
|
*/
|
||||||
|
@Inject
|
||||||
|
@Named( value = "repositoryStorage#maven2" )
|
||||||
private RepositoryStorage repositoryStorage;
|
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 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,
|
public ProjectVersionMetadata resolveProjectVersion( RepositorySession session, String repoId, String namespace,
|
||||||
String projectId, String projectVersion )
|
String projectId, String projectVersion )
|
||||||
|
@ -81,8 +101,8 @@ public class DefaultMetadataResolver
|
||||||
{
|
{
|
||||||
MetadataRepository metadataRepository = session.getRepository();
|
MetadataRepository metadataRepository = session.getRepository();
|
||||||
|
|
||||||
ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId,
|
ProjectVersionMetadata metadata =
|
||||||
projectVersion );
|
metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
|
||||||
// TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated)
|
// 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
|
// 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
|
// This would also be better than checking for completeness - we can then refresh only when fixed (though
|
||||||
|
@ -159,8 +179,8 @@ public class DefaultMetadataResolver
|
||||||
{
|
{
|
||||||
MetadataRepository metadataRepository = session.getRepository();
|
MetadataRepository metadataRepository = session.getRepository();
|
||||||
Collection<String> namespaces = metadataRepository.getRootNamespaces( repoId );
|
Collection<String> namespaces = metadataRepository.getRootNamespaces( repoId );
|
||||||
Collection<String> storageNamespaces = repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>(
|
Collection<String> storageNamespaces =
|
||||||
namespaces ) );
|
repositoryStorage.listRootNamespaces( repoId, new ExcludesFilter<String>( namespaces ) );
|
||||||
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
|
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( log.isDebugEnabled() )
|
if ( log.isDebugEnabled() )
|
||||||
|
@ -193,9 +213,8 @@ public class DefaultMetadataResolver
|
||||||
Collection<String> namespaces = metadataRepository.getNamespaces( repoId, namespace );
|
Collection<String> namespaces = metadataRepository.getNamespaces( repoId, namespace );
|
||||||
Collection<String> exclusions = new ArrayList<String>( namespaces );
|
Collection<String> exclusions = new ArrayList<String>( namespaces );
|
||||||
exclusions.addAll( metadataRepository.getProjects( repoId, namespace ) );
|
exclusions.addAll( metadataRepository.getProjects( repoId, namespace ) );
|
||||||
Collection<String> storageNamespaces = repositoryStorage.listNamespaces( repoId, namespace,
|
Collection<String> storageNamespaces =
|
||||||
new ExcludesFilter<String>(
|
repositoryStorage.listNamespaces( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
|
||||||
exclusions ) );
|
|
||||||
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
|
if ( storageNamespaces != null && !storageNamespaces.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( log.isDebugEnabled() )
|
if ( log.isDebugEnabled() )
|
||||||
|
@ -228,8 +247,8 @@ public class DefaultMetadataResolver
|
||||||
Collection<String> projects = metadataRepository.getProjects( repoId, namespace );
|
Collection<String> projects = metadataRepository.getProjects( repoId, namespace );
|
||||||
Collection<String> exclusions = new ArrayList<String>( projects );
|
Collection<String> exclusions = new ArrayList<String>( projects );
|
||||||
exclusions.addAll( metadataRepository.getNamespaces( repoId, namespace ) );
|
exclusions.addAll( metadataRepository.getNamespaces( repoId, namespace ) );
|
||||||
Collection<String> storageProjects = repositoryStorage.listProjects( repoId, namespace,
|
Collection<String> storageProjects =
|
||||||
new ExcludesFilter<String>( exclusions ) );
|
repositoryStorage.listProjects( repoId, namespace, new ExcludesFilter<String>( exclusions ) );
|
||||||
if ( storageProjects != null && !storageProjects.isEmpty() )
|
if ( storageProjects != null && !storageProjects.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( log.isDebugEnabled() )
|
if ( log.isDebugEnabled() )
|
||||||
|
@ -278,10 +297,8 @@ public class DefaultMetadataResolver
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProjectVersionMetadata versionMetadata = repositoryStorage.readProjectVersionMetadata( repoId,
|
ProjectVersionMetadata versionMetadata =
|
||||||
namespace,
|
repositoryStorage.readProjectVersionMetadata( repoId, namespace, projectId, projectVersion );
|
||||||
projectId,
|
|
||||||
projectVersion );
|
|
||||||
for ( RepositoryListener listener : listeners )
|
for ( RepositoryListener listener : listeners )
|
||||||
{
|
{
|
||||||
listener.addArtifact( session, repoId, namespace, projectId, versionMetadata );
|
listener.addArtifact( session, repoId, namespace, projectId, versionMetadata );
|
||||||
|
@ -295,8 +312,8 @@ public class DefaultMetadataResolver
|
||||||
}
|
}
|
||||||
catch ( RepositoryStorageMetadataInvalidException e )
|
catch ( RepositoryStorageMetadataInvalidException e )
|
||||||
{
|
{
|
||||||
log.warn( "Not update project in metadata repository due to an error resolving it from storage: " +
|
log.warn( "Not update project in metadata repository due to an error resolving it from storage: "
|
||||||
e.getMessage() );
|
+ e.getMessage() );
|
||||||
|
|
||||||
for ( RepositoryListener listener : listeners )
|
for ( RepositoryListener listener : listeners )
|
||||||
{
|
{
|
||||||
|
@ -324,13 +341,11 @@ public class DefaultMetadataResolver
|
||||||
throws MetadataResolutionException
|
throws MetadataResolutionException
|
||||||
{
|
{
|
||||||
MetadataRepository metadataRepository = session.getRepository();
|
MetadataRepository metadataRepository = session.getRepository();
|
||||||
Collection<ArtifactMetadata> artifacts = metadataRepository.getArtifacts( repoId, namespace, projectId,
|
Collection<ArtifactMetadata> artifacts =
|
||||||
projectVersion );
|
metadataRepository.getArtifacts( repoId, namespace, projectId, projectVersion );
|
||||||
ExcludesFilter<String> filter = new ExcludesFilter<String>( createArtifactIdList( artifacts ) );
|
ExcludesFilter<String> filter = new ExcludesFilter<String>( createArtifactIdList( artifacts ) );
|
||||||
Collection<ArtifactMetadata> storageArtifacts = repositoryStorage.readArtifactsMetadata( repoId, namespace,
|
Collection<ArtifactMetadata> storageArtifacts =
|
||||||
projectId,
|
repositoryStorage.readArtifactsMetadata( repoId, namespace, projectId, projectVersion, filter );
|
||||||
projectVersion,
|
|
||||||
filter );
|
|
||||||
if ( storageArtifacts != null && !storageArtifacts.isEmpty() )
|
if ( storageArtifacts != null && !storageArtifacts.isEmpty() )
|
||||||
{
|
{
|
||||||
if ( log.isDebugEnabled() )
|
if ( log.isDebugEnabled() )
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?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>
|
|
@ -19,6 +19,7 @@ package org.apache.archiva.metadata.repository;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
||||||
import org.apache.archiva.metadata.model.CiManagement;
|
import org.apache.archiva.metadata.model.CiManagement;
|
||||||
import org.apache.archiva.metadata.model.Dependency;
|
import org.apache.archiva.metadata.model.Dependency;
|
||||||
|
@ -31,7 +32,6 @@ import org.apache.archiva.metadata.model.Organization;
|
||||||
import org.apache.archiva.metadata.model.ProjectMetadata;
|
import org.apache.archiva.metadata.model.ProjectMetadata;
|
||||||
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
|
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
|
||||||
import org.apache.archiva.metadata.model.Scm;
|
import org.apache.archiva.metadata.model.Scm;
|
||||||
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -44,7 +44,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class AbstractMetadataRepositoryTest
|
public abstract class AbstractMetadataRepositoryTest
|
||||||
extends PlexusInSpringTestCase
|
extends TestCase
|
||||||
{
|
{
|
||||||
protected static final String OTHER_REPO_ID = "other-repo";
|
protected static final String OTHER_REPO_ID = "other-repo";
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,13 @@
|
||||||
<artifactId>metadata-repository-api</artifactId>
|
<artifactId>metadata-repository-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
<groupId>org.sonatype.sisu</groupId>
|
||||||
<artifactId>plexus-spring</artifactId>
|
<artifactId>sisu-inject-plexus</artifactId>
|
||||||
<scope>test</scope>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sonatype.sisu</groupId>
|
||||||
|
<artifactId>sisu-guice</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-logging</groupId>
|
<groupId>commons-logging</groupId>
|
||||||
|
@ -92,7 +96,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-model</artifactId>
|
<artifactId>maven-model</artifactId>
|
||||||
<version>3.0-alpha-4</version>
|
<version>3.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
|
@ -19,12 +19,15 @@ package org.apache.archiva.metadata.repository.storage.maven2;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
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
|
public class DefaultArtifactMappingProvider
|
||||||
implements ArtifactMappingProvider
|
implements ArtifactMappingProvider
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,15 +22,21 @@ package org.apache.archiva.metadata.repository.storage.maven2;
|
||||||
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
import org.apache.archiva.metadata.model.ArtifactMetadata;
|
||||||
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
|
import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
|
||||||
import org.apache.maven.archiva.common.utils.VersionUtil;
|
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.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
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
|
public class Maven2RepositoryPathTranslator
|
||||||
implements RepositoryPathTranslator
|
implements RepositoryPathTranslator
|
||||||
{
|
{
|
||||||
|
@ -40,15 +46,29 @@ public class Maven2RepositoryPathTranslator
|
||||||
|
|
||||||
private static final Pattern TIMESTAMP_PATTERN = Pattern.compile( "([0-9]{8}.[0-9]{6})-([0-9]+).*" );
|
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;
|
private List<ArtifactMappingProvider> artifactMappingProviders;
|
||||||
|
|
||||||
public Maven2RepositoryPathTranslator()
|
public Maven2RepositoryPathTranslator()
|
||||||
{
|
{
|
||||||
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void initialize()
|
||||||
|
{
|
||||||
|
artifactMappingProviders = new ArrayList<ArtifactMappingProvider>(
|
||||||
|
applicationContext.getBeansOfType( ArtifactMappingProvider.class ).values() );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Maven2RepositoryPathTranslator( List<ArtifactMappingProvider> artifactMappingProviders )
|
public Maven2RepositoryPathTranslator( List<ArtifactMappingProvider> artifactMappingProviders )
|
||||||
{
|
{
|
||||||
this.artifactMappingProviders = artifactMappingProviders;
|
this.artifactMappingProviders = artifactMappingProviders;
|
||||||
|
@ -165,8 +185,8 @@ public class Maven2RepositoryPathTranslator
|
||||||
{
|
{
|
||||||
if ( !id.startsWith( projectId + "-" ) )
|
if ( !id.startsWith( projectId + "-" ) )
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id +
|
throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
|
||||||
"' doesn't start with artifact ID '" + projectId + "'" );
|
+ "' doesn't start with artifact ID '" + projectId + "'" );
|
||||||
}
|
}
|
||||||
|
|
||||||
MavenArtifactFacet facet = new MavenArtifactFacet();
|
MavenArtifactFacet facet = new MavenArtifactFacet();
|
||||||
|
@ -201,17 +221,17 @@ public class Maven2RepositoryPathTranslator
|
||||||
}
|
}
|
||||||
catch ( IllegalStateException e )
|
catch ( IllegalStateException e )
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
|
||||||
"Not a valid artifact path in a Maven 2 repository, filename '" + id +
|
+ "' doesn't contain a timestamped version matching snapshot '"
|
||||||
"' doesn't contain a timestamped version matching snapshot '" + projectVersion + "'" );
|
+ projectVersion + "'" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// invalid
|
// invalid
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Not a valid artifact path in a Maven 2 repository, filename '" + id + "' doesn't contain version '" +
|
"Not a valid artifact path in a Maven 2 repository, filename '" + id + "' doesn't contain version '"
|
||||||
projectVersion + "'" );
|
+ projectVersion + "'" );
|
||||||
}
|
}
|
||||||
|
|
||||||
String classifier;
|
String classifier;
|
||||||
|
@ -249,9 +269,9 @@ public class Maven2RepositoryPathTranslator
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException( "Not a valid artifact path in a Maven 2 repository, filename '" + id
|
||||||
"Not a valid artifact path in a Maven 2 repository, filename '" + id +
|
+ "' expected classifier or extension but got '"
|
||||||
"' expected classifier or extension but got '" + id.substring( index ) + "'" );
|
+ id.substring( index ) + "'" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ import org.apache.maven.model.MailingList;
|
||||||
import org.apache.maven.model.Model;
|
import org.apache.maven.model.Model;
|
||||||
import org.apache.maven.model.Organization;
|
import org.apache.maven.model.Organization;
|
||||||
import org.apache.maven.model.Scm;
|
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.DefaultModelBuildingRequest;
|
||||||
import org.apache.maven.model.building.ModelBuilder;
|
import org.apache.maven.model.building.ModelBuilder;
|
||||||
import org.apache.maven.model.building.ModelBuildingException;
|
import org.apache.maven.model.building.ModelBuildingException;
|
||||||
|
@ -48,6 +49,9 @@ import org.apache.maven.model.building.ModelBuildingRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Named;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -67,7 +71,7 @@ import java.util.List;
|
||||||
* The session is passed in as an argument to obtain any necessary resources, rather than the class being instantiated
|
* 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.
|
* 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
|
public class Maven2RepositoryStorage
|
||||||
implements RepositoryStorage
|
implements RepositoryStorage
|
||||||
|
@ -75,22 +79,31 @@ public class Maven2RepositoryStorage
|
||||||
/**
|
/**
|
||||||
* @plexus.requirement
|
* @plexus.requirement
|
||||||
*/
|
*/
|
||||||
private ModelBuilder builder;
|
private ModelBuilder builders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @plexus.requirement
|
* plexus.requirement
|
||||||
*/
|
*/
|
||||||
|
@Inject @Named(value = "archivaConfiguration#default")
|
||||||
private ArchivaConfiguration archivaConfiguration;
|
private ArchivaConfiguration archivaConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @plexus.requirement role-hint="maven2"
|
* plexus.requirement role-hint="maven2"
|
||||||
*/
|
*/
|
||||||
|
@Inject @Named(value = "repositoryPathTranslator#maven2")
|
||||||
private RepositoryPathTranslator pathTranslator;
|
private RepositoryPathTranslator pathTranslator;
|
||||||
|
|
||||||
private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
|
private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
|
||||||
|
|
||||||
private static final String METADATA_FILENAME = "maven-metadata.xml";
|
private static final String METADATA_FILENAME = "maven-metadata.xml";
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void initialize()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
ou ou
|
||||||
|
}
|
||||||
|
|
||||||
public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
|
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?
|
// TODO: could natively implement the "shared model" concept from the browse action to avoid needing it there?
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?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>
|
|
@ -60,11 +60,6 @@
|
||||||
<artifactId>commons-logging-api</artifactId>
|
<artifactId>commons-logging-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-all</artifactId>
|
<artifactId>mockito-all</artifactId>
|
||||||
|
|
|
@ -45,10 +45,6 @@
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.jcr</groupId>
|
<groupId>javax.jcr</groupId>
|
||||||
<artifactId>jcr</artifactId>
|
<artifactId>jcr</artifactId>
|
||||||
|
|
|
@ -44,11 +44,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>archiva-consumer-api</artifactId>
|
<artifactId>archiva-consumer-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
<groupId>org.apache.archiva</groupId>
|
<groupId>org.apache.archiva</groupId>
|
||||||
<artifactId>maven2-repository</artifactId>
|
<artifactId>maven2-repository</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
|
||||||
<artifactId>plexus-spring</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
|
|
@ -16,12 +16,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<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>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
43
pom.xml
43
pom.xml
|
@ -77,9 +77,7 @@
|
||||||
<exclude>org.codehaus.plexus:plexus-log4j-logging</exclude>
|
<exclude>org.codehaus.plexus:plexus-log4j-logging</exclude>
|
||||||
|
|
||||||
<exclude>org.codehaus.plexus:plexus-spring</exclude>
|
<exclude>org.codehaus.plexus:plexus-spring</exclude>
|
||||||
<!--
|
|
||||||
<exclude>org.codehaus.redback:plexus-spring</exclude>
|
<exclude>org.codehaus.redback:plexus-spring</exclude>
|
||||||
-->
|
|
||||||
<exclude>commons-logging:commons-logging</exclude>
|
<exclude>commons-logging:commons-logging</exclude>
|
||||||
<exclude>org.slf4j:jcl104-over-slf4j</exclude>
|
<exclude>org.slf4j:jcl104-over-slf4j</exclude>
|
||||||
<exclude>velocity:velocity-dep</exclude>
|
<exclude>velocity:velocity-dep</exclude>
|
||||||
|
@ -89,6 +87,8 @@
|
||||||
<exclude>ant:ant-optional</exclude>
|
<exclude>ant:ant-optional</exclude>
|
||||||
<exclude>xom:xom</exclude>
|
<exclude>xom:xom</exclude>
|
||||||
<exclude>org.codehaus.plexus:plexus-xwork-integration</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>plexus:plexus-utils</exclude>
|
||||||
<exclude>com.google.code.atinject:atinject</exclude>
|
<exclude>com.google.code.atinject:atinject</exclude>
|
||||||
<exclude>org.codehaus.plexus.cache:plexus-cache-api</exclude>
|
<exclude>org.codehaus.plexus.cache:plexus-cache-api</exclude>
|
||||||
|
@ -249,7 +249,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.8.2</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -267,6 +266,12 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>httpunit</groupId>
|
<groupId>httpunit</groupId>
|
||||||
<artifactId>httpunit</artifactId>
|
<artifactId>httpunit</artifactId>
|
||||||
|
@ -558,17 +563,24 @@
|
||||||
<artifactId>spring-utils</artifactId>
|
<artifactId>spring-utils</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
use this layer as some modules need to use maven apis
|
||||||
|
until we find a better solution
|
||||||
|
-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.redback.components</groupId>
|
<groupId>org.sonatype.sisu</groupId>
|
||||||
<artifactId>plexus-spring</artifactId>
|
<artifactId>sisu-inject-plexus</artifactId>
|
||||||
<version>1.3-SNAPSHOT</version>
|
<version>2.2.0</version>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-container-default</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sonatype.sisu</groupId>
|
||||||
|
<artifactId>sisu-guice</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>stax</groupId>
|
<groupId>stax</groupId>
|
||||||
<artifactId>stax</artifactId>
|
<artifactId>stax</artifactId>
|
||||||
|
@ -720,11 +732,6 @@
|
||||||
<artifactId>maven-model-builder</artifactId>
|
<artifactId>maven-model-builder</artifactId>
|
||||||
<version>${maven3x.version}</version>
|
<version>${maven3x.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-component-api</artifactId>
|
|
||||||
<version>1.0-alpha-22</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-digest</artifactId>
|
<artifactId>plexus-digest</artifactId>
|
||||||
|
@ -1268,7 +1275,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<struts.version>2.1.8.1</struts.version>
|
<struts.version>2.1.8.1</struts.version>
|
||||||
<maven.version>2.0.8</maven.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>
|
<wagon.version>1.0-beta-5</wagon.version>
|
||||||
<redback.version>1.3-SNAPSHOT</redback.version>
|
<redback.version>1.3-SNAPSHOT</redback.version>
|
||||||
<jetty.version>6.1.19</jetty.version>
|
<jetty.version>6.1.19</jetty.version>
|
||||||
|
|
Loading…
Reference in New Issue