aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2009-08-07 11:00:03 +0000
committerMaria Odea B. Ching <oching@apache.org>2009-08-07 11:00:03 +0000
commitd150a6ed98445bdaa6fa1ac8e511658193a02057 (patch)
tree130967ce12dc8fd5351b9d0b1ffa4b9bd588bf36 /archiva-modules
parent06ac3284ec3f86a9cd160c5bc7e2a80c80f2c51c (diff)
downloadarchiva-d150a6ed98445bdaa6fa1ac8e511658193a02057.tar.gz
archiva-d150a6ed98445bdaa6fa1ac8e511658193a02057.zip
[MRM-1194] Archiva doesn't cope with versions in a pom.xml that are properties
o get latest timestamped file if no -SNAPSHOT exists when resolving the pom o added tests git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@801946 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java5
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java35
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java47
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolverTest.java138
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090807.095532-1.pom23
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090808.085535-2.pom23
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-project/2.1-SNAPSHOT/sample-project-2.1-SNAPSHOT.pom47
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/generic-version/1.0-SNAPSHOT/generic-version-1.0-SNAPSHOT.pom9
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/released-version/1.0/released-version-1.0.pom9
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090807.070903-1.pom9
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.051902-2.pom9
-rw-r--r--archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.081025-3.pom9
12 files changed, 358 insertions, 5 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java
index 242d1413a..54f9b44aa 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java
@@ -420,4 +420,9 @@ public class ManagedDefaultRepositoryContent
return false;
}
}
+
+ public void setFiletypes( FileTypes filetypes )
+ {
+ this.filetypes = filetypes;
+ }
}
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java
index 91e71d6d9..12d177fba 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java
@@ -20,16 +20,23 @@ package org.apache.maven.archiva.repository.project.resolvers;
*/
import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.maven.archiva.common.utils.VersionComparator;
+import org.apache.maven.archiva.common.utils.VersionUtil;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArchivaProjectModel;
import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.ContentNotFoundException;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.repository.project.ProjectModelException;
import org.apache.maven.archiva.repository.project.ProjectModelReader;
import org.apache.maven.archiva.repository.project.ProjectModelResolver;
import org.apache.maven.archiva.xml.XMLException;
+
/**
* Resolve Project from managed repository.
*
@@ -50,12 +57,33 @@ public class ManagedRepositoryProjectResolver
public ArchivaProjectModel resolveProjectModel( VersionedReference reference )
throws ProjectModelException
- {
+ {
ArchivaArtifact artifact = new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference
.getVersion(), "", "pom", repository.getId() );
-
+
File repoFile = repository.toFile( artifact );
-
+
+ // MRM-1194
+ if( !repoFile.exists() && VersionUtil.isGenericSnapshot( reference.getVersion() ) )
+ {
+ // check if a timestamped version exists, get the latest if true
+ try
+ {
+ List<String> versions = new ArrayList<String>( repository.getVersions( reference ) );
+ Collections.sort( versions, VersionComparator.getInstance() );
+ String latestSnapshot = versions.get( versions.size() - 1 );
+ artifact =
+ new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), latestSnapshot, "", "pom",
+ repository.getId() );
+
+ repoFile = repository.toFile( artifact );
+ }
+ catch( ContentNotFoundException e )
+ {
+ throw new ProjectModelException( e.getMessage(), e );
+ }
+ }
+
try
{
return reader.read( repoFile );
@@ -65,5 +93,4 @@ public class ManagedRepositoryProjectResolver
throw new ProjectModelException( e.getMessage(), e );
}
}
-
}
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java
index fae996e6f..e5990f774 100644
--- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java
@@ -21,6 +21,7 @@ package org.apache.maven.archiva.repository.project.filters;
import org.apache.maven.archiva.common.utils.VersionUtil;
import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.Dependency;
import org.apache.maven.archiva.model.Individual;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
@@ -84,6 +85,7 @@ public class EffectiveProjectModelFilterTest
assertEffectiveProject(
"/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom",
"/archiva-model-effective.pom");
+
assertEffectiveProject(
"/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom",
"/test-project-model-effective.pom");
@@ -220,6 +222,49 @@ public class EffectiveProjectModelFilterTest
assertTrue( passedWagonVersionChecking );
}
+ // MRM-1194
+ public void testEffectiveProjectPropertyExistingParentHasUniqueSnapshotVersion()
+ throws Exception
+ {
+ initTestResolverFactory();
+ EffectiveProjectModelFilter filter = lookupEffective();
+
+ String pomFile = "/org/apache/archiva/sample-project/2.1-SNAPSHOT/sample-project-2.1-SNAPSHOT.pom";
+ ArchivaProjectModel startModel = createArchivaProjectModel( DEFAULT_REPOSITORY + pomFile );
+
+ String buildHelperPluginVersion = "1.0";
+
+ boolean passedBuildHelperVersionChecking = false;
+
+ List<ArtifactReference> startPlugins = startModel.getPlugins();
+ for( ArtifactReference plugin : startPlugins )
+ {
+ if( "build-helper-maven-plugin".equals( plugin.getArtifactId() ) )
+ {
+ assertEquals( "${build-helper-maven-plugin.version}", plugin.getVersion() );
+ }
+ }
+
+ ArchivaProjectModel effectiveModel = filter.filter( startModel );
+
+ List<ArtifactReference> effectivePlugins = effectiveModel.getPlugins();
+ for( ArtifactReference plugin : effectivePlugins )
+ {
+ if( "build-helper-maven-plugin".equals( plugin.getArtifactId() ) )
+ {
+ assertEquals( buildHelperPluginVersion, plugin.getVersion() );
+
+ if ( !passedBuildHelperVersionChecking )
+ {
+ passedBuildHelperVersionChecking = true;
+ }
+ }
+ }
+
+ assertTrue( passedBuildHelperVersionChecking );
+ }
+
+
private ProjectModelResolverFactory initTestResolverFactory()
throws Exception
{
@@ -241,7 +286,7 @@ public class EffectiveProjectModelFilterTest
assertContainsSameDependencies( "Dependencies", expectedModel.getDependencies(), effectiveModel
.getDependencies() );
assertContainsSameDependencies( "DependencyManagement", expectedModel.getDependencyManagement(), effectiveModel
- .getDependencyManagement() );
+ .getDependencyManagement() );
}
private void dumpDependencyList( String type, List<Dependency> deps )
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolverTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolverTest.java
new file mode 100644
index 000000000..51048beff
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolverTest.java
@@ -0,0 +1,138 @@
+package org.apache.maven.archiva.repository.project.resolvers;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+
+import org.apache.maven.archiva.configuration.FileTypes;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.content.ManagedDefaultRepositoryContent;
+import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
+public class ManagedRepositoryProjectResolverTest
+ extends PlexusInSpringTestCase
+{
+ private ManagedRepositoryProjectResolver resolver;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ FileTypes fileTypes = new MockFileTypes();
+
+ ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration();
+ repoConfig.setId( "test-repo" );
+ repoConfig.setLocation( new File( getBasedir(), "target/test-classes/test-repo" ).getPath() );
+ repoConfig.setName( "Test Repository" );
+
+ ManagedDefaultRepositoryContent repository = new ManagedDefaultRepositoryContent();
+ repository.setRepository( repoConfig );
+ repository.setFiletypes( fileTypes );
+
+ resolver = new ManagedRepositoryProjectResolver( repository, new ProjectModel400Reader() );
+ }
+
+ public void testResolveSnapshotUniqueVersionPresent()
+ throws Exception
+ {
+ VersionedReference ref = new VersionedReference();
+ ref.setGroupId( "org.apache.archiva" );
+ ref.setArtifactId( "unique-version" );
+ ref.setVersion( "1.0-SNAPSHOT" );
+
+ try
+ {
+ ArchivaProjectModel model = resolver.resolveProjectModel( ref );
+
+ assertNotNull( model );
+ assertEquals( "org.apache.archiva", model.getGroupId() );
+ assertEquals( "unique-version", model.getArtifactId() );
+ assertEquals( "1.0-SNAPSHOT", model.getVersion() );
+ assertEquals( "Unique Version Snapshot - Build 3", model.getName() );
+ }
+ catch ( Exception e )
+ {
+ fail( "The latest timestamp should have been found!" );
+ }
+ }
+
+ public void testResolveSnapshotGenericVersionPresent()
+ throws Exception
+ {
+ VersionedReference ref = new VersionedReference();
+ ref.setGroupId( "org.apache.archiva" );
+ ref.setArtifactId( "generic-version" );
+ ref.setVersion( "1.0-SNAPSHOT" );
+
+ ArchivaProjectModel model = resolver.resolveProjectModel( ref );
+
+ assertNotNull( model );
+ assertEquals( "org.apache.archiva", model.getGroupId() );
+ assertEquals( "generic-version", model.getArtifactId() );
+ assertEquals( "1.0-SNAPSHOT", model.getVersion() );
+ }
+
+ public void testResolveSuccessful()
+ throws Exception
+ {
+ VersionedReference ref = new VersionedReference();
+ ref.setGroupId( "org.apache.archiva" );
+ ref.setArtifactId( "released-version" );
+ ref.setVersion( "1.0" );
+
+ ArchivaProjectModel model = resolver.resolveProjectModel( ref );
+
+ assertNotNull( model );
+ assertEquals( "org.apache.archiva", model.getGroupId() );
+ assertEquals( "released-version", model.getArtifactId() );
+ assertEquals( "1.0", model.getVersion() );
+ }
+
+ public void testResolveNotFound()
+ throws Exception
+ {
+ VersionedReference ref = new VersionedReference();
+ ref.setGroupId( "org.apache.archiva" );
+ ref.setArtifactId( "non-existant" );
+ ref.setVersion( "2.0" );
+
+ try
+ {
+ resolver.resolveProjectModel( ref );
+ fail( "An exception should have been thrown." );
+ }
+ catch( Exception e )
+ {
+ assertTrue( true );
+ }
+ }
+
+ class MockFileTypes
+ extends FileTypes
+ {
+ public boolean matchesArtifactPattern( String relativePath )
+ {
+ return true;
+ }
+ }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090807.095532-1.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090807.095532-1.pom
new file mode 100644
index 000000000..55fdf5d28
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090807.095532-1.pom
@@ -0,0 +1,23 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>sample-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>2.1-SNAPSHOT</version>
+ <name>sample-parent Build 1</name>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <properties>
+ <build-helper-maven-plugin.version>1.0</build-helper-maven-plugin.version>
+ </properties>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090808.085535-2.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090808.085535-2.pom
new file mode 100644
index 000000000..ffc575bbc
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-parent/2.1-SNAPSHOT/sample-parent-2.1-20090808.085535-2.pom
@@ -0,0 +1,23 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>sample-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>2.1-SNAPSHOT</version>
+ <name>sample-parent Build 2</name>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <properties>
+ <build-helper-maven-plugin.version>1.0</build-helper-maven-plugin.version>
+ </properties>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-project/2.1-SNAPSHOT/sample-project-2.1-SNAPSHOT.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-project/2.1-SNAPSHOT/sample-project-2.1-SNAPSHOT.pom
new file mode 100644
index 000000000..b9e7e38a1
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/archiva/sample-project/2.1-SNAPSHOT/sample-project-2.1-SNAPSHOT.pom
@@ -0,0 +1,47 @@
+<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>
+ <parent>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>sample-parent</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>sample-project</artifactId>
+ <packaging>jar</packaging>
+ <name>sample-project</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${build-helper-maven-plugin.version}</version>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/java-gen</source>
+ <source>${basedir}/java-src</source>
+ <source>${basedir}/java-test</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/generic-version/1.0-SNAPSHOT/generic-version-1.0-SNAPSHOT.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/generic-version/1.0-SNAPSHOT/generic-version-1.0-SNAPSHOT.pom
new file mode 100644
index 000000000..64ddc4d74
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/generic-version/1.0-SNAPSHOT/generic-version-1.0-SNAPSHOT.pom
@@ -0,0 +1,9 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>generic-version</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Generic Snapshot Version</name>
+ <packaging>pom</packaging>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/released-version/1.0/released-version-1.0.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/released-version/1.0/released-version-1.0.pom
new file mode 100644
index 000000000..1a7f85e65
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/released-version/1.0/released-version-1.0.pom
@@ -0,0 +1,9 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>released-version</artifactId>
+ <version>1.0</version>
+ <name>Released Version</name>
+ <packaging>pom</packaging>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090807.070903-1.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090807.070903-1.pom
new file mode 100644
index 000000000..4ccc67759
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090807.070903-1.pom
@@ -0,0 +1,9 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>unique-version</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Unique Version Snapshot - Build 1</name>
+ <packaging>pom</packaging>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.051902-2.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.051902-2.pom
new file mode 100644
index 000000000..2662a0ea8
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.051902-2.pom
@@ -0,0 +1,9 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>unique-version</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Unique Version Snapshot - Build 2</name>
+ <packaging>pom</packaging>
+</project> \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.081025-3.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.081025-3.pom
new file mode 100644
index 000000000..597e65408
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/test-repo/org/apache/archiva/unique-version/1.0-SNAPSHOT/unique-version-1.0-20090808.081025-3.pom
@@ -0,0 +1,9 @@
+<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>org.apache.archiva</groupId>
+ <artifactId>unique-version</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Unique Version Snapshot - Build 3</name>
+ <packaging>pom</packaging>
+</project> \ No newline at end of file