From d29cdf4ab1f77b962802f92f9d94c707fbb39037 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Tue, 5 Sep 2006 05:12:31 +0000 Subject: [PATCH] [MRM-161] move the query layer to a separate module git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@440260 13f79535-47bb-0310-9956-ffa450edef68 --- archiva-reports-standard/pom.xml | 4 ++ .../reporting/BadMetadataReportProcessor.java | 2 + .../DefaultArtifactReportProcessor.java | 1 + .../AbstractRepositoryQueryLayerTestCase.java | 2 + .../maven/archiva/reporting/CacheTest.java | 1 + .../CachedRepositoryQueryLayerTest.java | 2 + .../reporting/MockRepositoryQueryLayer.java | 3 +- archiva-repository-layer/pom.xml | 43 +++++++++++++++++++ .../layer}/AbstractRepositoryQueryLayer.java | 2 +- .../apache/maven/archiva/layer}/Cache.java | 2 +- .../layer}/CachedRepositoryQueryLayer.java | 4 +- .../layer}/DefaultRepositoryQueryLayer.java | 4 +- .../DefaultRepositoryQueryLayerFactory.java | 6 +-- .../archiva/layer}/RepositoryQueryLayer.java | 5 +-- .../layer}/RepositoryQueryLayerException.java | 2 +- .../layer}/RepositoryQueryLayerFactory.java | 4 +- pom.xml | 9 +++- 17 files changed, 78 insertions(+), 18 deletions(-) create mode 100644 archiva-repository-layer/pom.xml rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/AbstractRepositoryQueryLayer.java (98%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/Cache.java (99%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/CachedRepositoryQueryLayer.java (98%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/DefaultRepositoryQueryLayer.java (94%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/DefaultRepositoryQueryLayerFactory.java (82%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/RepositoryQueryLayer.java (87%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/RepositoryQueryLayerException.java (95%) rename {archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting => archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer}/RepositoryQueryLayerFactory.java (89%) diff --git a/archiva-reports-standard/pom.xml b/archiva-reports-standard/pom.xml index 64df5f2d6..6a0bb7183 100755 --- a/archiva-reports-standard/pom.xml +++ b/archiva-reports-standard/pom.xml @@ -57,6 +57,10 @@ org.apache.maven.archiva archiva-utils + + org.apache.maven.archiva + archiva-repository-layer + org.apache.maven.archiva archiva-indexer diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessor.java index bb3869ad2..733524002 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessor.java @@ -16,6 +16,8 @@ package org.apache.maven.archiva.reporting; * limitations under the License. */ +import org.apache.maven.archiva.layer.RepositoryQueryLayer; +import org.apache.maven.archiva.layer.RepositoryQueryLayerFactory; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultArtifactReportProcessor.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultArtifactReportProcessor.java index 040113af6..22e220a66 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultArtifactReportProcessor.java +++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultArtifactReportProcessor.java @@ -16,6 +16,7 @@ package org.apache.maven.archiva.reporting; * limitations under the License. */ +import org.apache.maven.archiva.layer.RepositoryQueryLayer; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayerTestCase.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayerTestCase.java index 0774095d5..52fd4efc5 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayerTestCase.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayerTestCase.java @@ -16,6 +16,8 @@ package org.apache.maven.archiva.reporting; * limitations under the License. */ +import org.apache.maven.archiva.layer.CachedRepositoryQueryLayer; +import org.apache.maven.archiva.layer.RepositoryQueryLayerException; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.repository.ArtifactRepository; diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CacheTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CacheTest.java index 123e92f30..65d6f8109 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CacheTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CacheTest.java @@ -17,6 +17,7 @@ package org.apache.maven.archiva.reporting; */ import junit.framework.TestCase; +import org.apache.maven.archiva.layer.Cache; /** * diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayerTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayerTest.java index 44e3d3108..bba92c722 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayerTest.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayerTest.java @@ -1,5 +1,7 @@ package org.apache.maven.archiva.reporting; +import org.apache.maven.archiva.layer.CachedRepositoryQueryLayer; + /* * Copyright 2005-2006 The Apache Software Foundation. * diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/MockRepositoryQueryLayer.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/MockRepositoryQueryLayer.java index 6657a29a0..e1aa69ac2 100644 --- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/MockRepositoryQueryLayer.java +++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/MockRepositoryQueryLayer.java @@ -16,6 +16,7 @@ package org.apache.maven.archiva.reporting; * limitations under the License. */ +import org.apache.maven.archiva.layer.RepositoryQueryLayer; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.metadata.Snapshot; @@ -25,7 +26,7 @@ import java.util.Iterator; import java.util.List; /** - * + * */ public class MockRepositoryQueryLayer implements RepositoryQueryLayer diff --git a/archiva-repository-layer/pom.xml b/archiva-repository-layer/pom.xml new file mode 100644 index 000000000..3b177c22e --- /dev/null +++ b/archiva-repository-layer/pom.xml @@ -0,0 +1,43 @@ + + + + + + + archiva + org.apache.maven.archiva + 1.0-SNAPSHOT + + 4.0.0 + org.apache.maven.archiva + archiva-repository-layer + Archiva Repository Interface Layer + + + org.apache.maven + maven-artifact + + + org.apache.maven + maven-artifact-manager + + + org.apache.maven + maven-repository-metadata + + + diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java similarity index 98% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayer.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java index 8d9bc6e3e..60b0e5bb0 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/AbstractRepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayer.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Cache.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/Cache.java similarity index 99% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Cache.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/Cache.java index 2559cf2e2..fc68f9ca6 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Cache.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/Cache.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java similarity index 98% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayer.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java index 7b455899a..91f9c5ff9 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/CachedRepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. @@ -23,7 +23,7 @@ import org.apache.maven.artifact.repository.metadata.Snapshot; /** - * + * */ public class CachedRepositoryQueryLayer extends AbstractRepositoryQueryLayer diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java similarity index 94% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayer.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java index 4b000fbe6..582d5f377 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. @@ -19,7 +19,7 @@ package org.apache.maven.archiva.reporting; import org.apache.maven.artifact.repository.ArtifactRepository; /** - * + * */ public class DefaultRepositoryQueryLayer extends AbstractRepositoryQueryLayer diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayerFactory.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java similarity index 82% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayerFactory.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java index ec607b6f1..ebfcd18cf 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/DefaultRepositoryQueryLayerFactory.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. @@ -22,8 +22,8 @@ import org.apache.maven.artifact.repository.ArtifactRepository; * Gets the default implementation of a repository query layer for the given repository. * * @author Brett Porter - * @version $Id$ - * @plexus.component role="org.apache.maven.archiva.reporting.RepositoryQueryLayerFactory" + * @version $Id:DefaultRepositoryQueryLayerFactory.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $ + * @plexus.component role="org.apache.maven.archiva.layer.RepositoryQueryLayerFactory" */ public class DefaultRepositoryQueryLayerFactory implements RepositoryQueryLayerFactory diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java similarity index 87% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayer.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java index bde683ed9..93c57ef1f 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayer.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. @@ -30,9 +30,6 @@ public interface RepositoryQueryLayer boolean containsArtifact( Artifact artifact ); - /** - * @todo I believe we can remove this [BP] - artifact should contain all the necessary version info! - */ boolean containsArtifact( Artifact artifact, Snapshot snapshot ); List getVersions( Artifact artifact ) diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerException.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java similarity index 95% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerException.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java index a95415398..772bf4666 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerException.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerFactory.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java similarity index 89% rename from archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerFactory.java rename to archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java index e69527b5e..61142e937 100644 --- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryQueryLayerFactory.java +++ b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java @@ -1,4 +1,4 @@ -package org.apache.maven.archiva.reporting; +package org.apache.maven.archiva.layer; /* * Copyright 2005-2006 The Apache Software Foundation. @@ -22,7 +22,7 @@ import org.apache.maven.artifact.repository.ArtifactRepository; * Gets the preferred implementation of a repository query layer for the given repository. * * @author Brett Porter - * @version $Id$ + * @version $Id:RepositoryQueryLayerFactory.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $ */ public interface RepositoryQueryLayerFactory { diff --git a/pom.xml b/pom.xml index a81e96b20..6b02a1c8d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,8 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.apache.maven @@ -126,6 +127,7 @@ archiva-core archiva-configuration maven-meeper + archiva-repository-layer @@ -212,6 +214,11 @@ archiva-discoverer ${pom.version} + + org.apache.maven.archiva + archiva-repository-layer + ${pom.version} + org.apache.maven.archiva archiva-indexer -- 2.39.5