summaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2010-03-09 04:24:32 +0000
committerBrett Porter <brett@apache.org>2010-03-09 04:24:32 +0000
commitaf2a929978a21ddd615ab84e3b1bb4ebe3c7f3b7 (patch)
tree10dce8d1df9091c234215bc5427de75d18c9ea76 /archiva-modules/metadata
parent49eab5d3daab2ced8fb57f2abf63dffd91e14e43 (diff)
downloadarchiva-af2a929978a21ddd615ab84e3b1bb4ebe3c7f3b7.tar.gz
archiva-af2a929978a21ddd615ab84e3b1bb4ebe3c7f3b7.zip
[MNG-1301] remove the problem reports dependency on the repository layer, start to migrate path parsing into metadata API
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@920649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java7
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java33
-rw-r--r--archiva-modules/metadata/pom.xml3
-rw-r--r--archiva-modules/metadata/test-repository/pom.xml13
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt1
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml13
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md51
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha11
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jarbin0 -> 2367 bytes
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md51
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha11
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom24
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md51
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha11
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml12
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md51
-rw-r--r--archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha11
17 files changed, 113 insertions, 1 deletions
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java
index c877ec8ec..ee9358219 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java
@@ -19,6 +19,8 @@ package org.apache.archiva.metadata.repository.storage;
* under the License.
*/
+import org.apache.archiva.metadata.model.ArtifactMetadata;
+
import java.io.File;
public interface RepositoryPathTranslator
@@ -32,4 +34,9 @@ public interface RepositoryPathTranslator
File toFile( File basedir, String namespace );
File toFile( File basedir, String namespace, String projectId, String projectVersion );
+
+ ArtifactMetadata getArtifactForPath( String repoId, String relativePath );
+
+ ArtifactMetadata getArtifactFromId( String repoId, String namespace, String projectId, String projectVersion,
+ String id );
}
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java
new file mode 100644
index 000000000..2978d1a9b
--- /dev/null
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java
@@ -0,0 +1,33 @@
+package org.apache.archiva.repository.events;
+
+/*
+ * 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.
+ */
+
+/**
+ * Listen to events on the repository. This class is a stopgap
+ * refactoring measure until an event bus is in place to handle
+ * generic events such as these.
+ */
+public interface RepositoryListener
+{
+ /**
+ * Event for the deletion of a given artifact.
+ */
+ void deleteArtifact( String repositoryId, String namespace, String project, String version, String id );
+}
diff --git a/archiva-modules/metadata/pom.xml b/archiva-modules/metadata/pom.xml
index 646612a45..fc3c88642 100644
--- a/archiva-modules/metadata/pom.xml
+++ b/archiva-modules/metadata/pom.xml
@@ -29,5 +29,6 @@
<modules>
<module>metadata-model</module>
<module>metadata-repository-api</module>
+ <module>test-repository</module>
</modules>
-</project>
+</project> \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/pom.xml b/archiva-modules/metadata/test-repository/pom.xml
new file mode 100644
index 000000000..2755b31ec
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>metadata</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <version>1.4-SNAPSHOT</version>
+ </parent>
+ <artifactId>test-repository</artifactId>
+ <name>Archiva Repository for Testing</name>
+</project>
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt b/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt
new file mode 100644
index 000000000..acfe11318
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt
@@ -0,0 +1 @@
+invalid path
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 000000000..89f58d525
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.example.test</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <timestamp>20100308.230825</timestamp>
+ <buildNumber>1</buildNumber>
+ </snapshot>
+ <lastUpdated>20100308230825</lastUpdated>
+ </versioning>
+</metadata>
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5
new file mode 100644
index 000000000..d774a5365
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5
@@ -0,0 +1 @@
+7210867ac16cd955db89cfca699e7c96 \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1
new file mode 100644
index 000000000..0e44079af
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+271faeb2039d026ee6a3c937375b5ff7d4b1d605 \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar
new file mode 100644
index 000000000..dab36c0bb
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar
Binary files differ
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5
new file mode 100644
index 000000000..e98bc51e4
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5
@@ -0,0 +1 @@
+cc2236dd70af3667080a786c7dcb4a9b \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1
new file mode 100644
index 000000000..2d7e3840f
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1
@@ -0,0 +1 @@
+edf5938e646956f445c6ecb719d44579cdeed974 \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom
new file mode 100644
index 000000000..69a7d1689
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.example.test</groupId>
+ <artifactId>test-artifact</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>test-artifact</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <repository>
+ <id>test-repo</id>
+ <url>file:${basedir}/repository</url>
+ </repository>
+ </distributionManagement>
+</project>
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5
new file mode 100644
index 000000000..531fc330c
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5
@@ -0,0 +1 @@
+ce7eeb9586dc4992dc961d9f3a28006b \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1
new file mode 100644
index 000000000..c0edca2a1
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1
@@ -0,0 +1 @@
+be040c8462fd31d4e03749e3586afbb21f43594e \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml
new file mode 100644
index 000000000..2678fa1dc
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>com.example.test</groupId>
+ <artifactId>test-artifact</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <versioning>
+ <versions>
+ <version>1.0-SNAPSHOT</version>
+ </versions>
+ <lastUpdated>20100308230825</lastUpdated>
+ </versioning>
+</metadata>
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5
new file mode 100644
index 000000000..3dff69b48
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5
@@ -0,0 +1 @@
+93afaac7340faadc7efd097952d79fa4 \ No newline at end of file
diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1
new file mode 100644
index 000000000..1ff7fb544
--- /dev/null
+++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+d59d588343d61fd7d838984a0daa4aaa2546bf9d \ No newline at end of file