]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1282] handle snapshot versions
authorBrett Porter <brett@apache.org>
Wed, 25 Nov 2009 05:32:18 +0000 (05:32 +0000)
committerBrett Porter <brett@apache.org>
Wed, 25 Nov 2009 05:32:18 +0000 (05:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@883981 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/plugins/maven2-repository/pom.xml
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadata.java [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReader.java [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReaderTest.java [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/apache-5-20080801.151215-1.pom [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/maven-metadata.xml [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/maven/shared/maven-downloader/maven-metadata.xml [new file with mode: 0644]
pom.xml

index 1524507c7de857b817757faffd09cd1cca300919..0256af235ea92f4292eee3bd809f387ab72090fb 100644 (file)
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model-builder</artifactId>
-      <version>3.0-alpha-4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-configuration</artifactId>
-      <version>1.3-SNAPSHOT</version>
+    </dependency>
+    <!-- TODO: aim to remove this dependency -->
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-xml-tools</artifactId>
     </dependency>
   </dependencies>
   <dependencyManagement>
index 4fa1213736880aaefd79228caa548e2531d03583..c8fed10113ed77c9486f50593890d31738bcf46d 100644 (file)
@@ -22,12 +22,14 @@ package org.apache.archiva.metadata.repository.storage.maven2;
 import java.io.File;
 import java.util.Collection;
 
-import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectMetadata;
+import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.MetadataResolver;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
+import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.xml.XMLException;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.DefaultModelBuildingRequest;
 import org.apache.maven.model.building.ModelBuilder;
@@ -60,16 +62,40 @@ public class Maven2RepositoryMetadataResolver
         throw new UnsupportedOperationException();
     }
 
-    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
+    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
+                                                     String projectVersion )
     {
         // TODO: artifactVersion translation
 
         ManagedRepositoryConfiguration repositoryConfiguration =
             archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId );
 
+        String artifactVersion = projectVersion;
+
         File basedir = new File( repositoryConfiguration.getLocation() );
-        File file = pathTranslator.toFile( basedir, namespace, projectId, projectVersion, projectId + "-" +
-            projectVersion + ".pom" );
+        if ( VersionUtil.isSnapshot( projectVersion ) )
+        {
+            // TODO: need much error handling here for incorrect metadata
+            try
+            {
+                MavenRepositoryMetadata metadata = MavenRepositoryMetadataReader.read(
+                    pathTranslator.toFile( basedir, namespace, projectId, projectVersion, "maven-metadata.xml" ) );
+
+                artifactVersion =
+                    artifactVersion.substring( 0, artifactVersion.length() - 8 ); // remove SNAPSHOT from end
+                MavenRepositoryMetadata.Snapshot snapshotVersion = metadata.getSnapshotVersion();
+                artifactVersion =
+                    artifactVersion + snapshotVersion.getTimestamp() + "-" + snapshotVersion.getBuildNumber();
+            }
+            catch ( XMLException e )
+            {
+                // TODO: handle it
+                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            }
+        }
+
+        File file = pathTranslator.toFile( basedir, namespace, projectId, projectVersion,
+                                           projectId + "-" + artifactVersion + ".pom" );
 
         ModelBuildingRequest req = new DefaultModelBuildingRequest();
         req.setProcessPlugins( false );
@@ -107,7 +133,8 @@ public class Maven2RepositoryMetadataResolver
         return metadata;
     }
 
-    public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
+    public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
+                                                   String projectVersion )
     {
         throw new UnsupportedOperationException();
     }
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadata.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadata.java
new file mode 100644 (file)
index 0000000..b5ef400
--- /dev/null
@@ -0,0 +1,200 @@
+package org.apache.archiva.metadata.repository.storage.maven2;
+
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+public class MavenRepositoryMetadata
+{
+    private String groupId;
+
+    private String artifactId;
+
+    private String version;
+
+    private String lastUpdated;
+
+    private String latestVersion;
+
+    private String releasedVersion;
+
+    private List<String> availableVersions;
+
+    private Snapshot snapshotVersion;
+
+    private List<Plugin> plugins = new ArrayList<Plugin>();
+
+    public List<Plugin> getPlugins()
+    {
+        return plugins;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        this.groupId = groupId;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        this.artifactId = artifactId;
+    }
+
+    public void setVersion( String version )
+    {
+        this.version = version;
+    }
+
+    public void setLastUpdated( String lastUpdated )
+    {
+        this.lastUpdated = lastUpdated;
+    }
+
+    public void setLatestVersion( String latestVersion )
+    {
+        this.latestVersion = latestVersion;
+    }
+
+    public void setReleasedVersion( String releasedVersion )
+    {
+        this.releasedVersion = releasedVersion;
+    }
+
+    public void setAvailableVersions( List<String> availableVersions )
+    {
+        this.availableVersions = availableVersions;
+    }
+
+    public void setSnapshotVersion( Snapshot snapshotVersion )
+    {
+        this.snapshotVersion = snapshotVersion;
+    }
+
+    public void addPlugin( Plugin plugin )
+    {
+        this.plugins.add( plugin );
+    }
+
+    public String getGroupId()
+    {
+        return groupId;
+    }
+
+    public String getArtifactId()
+    {
+        return artifactId;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    public String getLastUpdated()
+    {
+        return lastUpdated;
+    }
+
+    public String getLatestVersion()
+    {
+        return latestVersion;
+    }
+
+    public String getReleasedVersion()
+    {
+        return releasedVersion;
+    }
+
+    public List<String> getAvailableVersions()
+    {
+        return availableVersions;
+    }
+
+    public Snapshot getSnapshotVersion()
+    {
+        return snapshotVersion;
+    }
+
+    public static class Snapshot
+    {
+        private String timestamp;
+
+        private int buildNumber;
+
+        public void setTimestamp( String timestamp )
+        {
+            this.timestamp = timestamp;
+        }
+
+        public void setBuildNumber( int buildNumber )
+        {
+            this.buildNumber = buildNumber;
+        }
+
+        public int getBuildNumber()
+        {
+            return buildNumber;
+        }
+
+        public String getTimestamp()
+        {
+            return timestamp;
+        }
+    }
+
+    public static class Plugin
+    {
+        private String prefix;
+
+        private String artifactId;
+
+        private String name;
+
+        public void setPrefix( String prefix )
+        {
+            this.prefix = prefix;
+        }
+
+        public void setArtifactId( String artifactId )
+        {
+            this.artifactId = artifactId;
+        }
+
+        public void setName( String name )
+        {
+            this.name = name;
+        }
+
+        public String getPrefix()
+        {
+            return prefix;
+        }
+
+        public String getArtifactId()
+        {
+            return artifactId;
+        }
+
+        public String getName()
+        {
+            return name;
+        }
+    }
+}
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReader.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReader.java
new file mode 100644 (file)
index 0000000..a56f0be
--- /dev/null
@@ -0,0 +1,90 @@
+package org.apache.archiva.metadata.repository.storage.maven2;
+
+/*
+ * 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.commons.lang.math.NumberUtils;
+import org.apache.maven.archiva.xml.XMLException;
+import org.apache.maven.archiva.xml.XMLReader;
+import org.dom4j.Element;
+
+/**
+ * RepositoryMetadataReader - read maven-metadata.xml files.
+ *
+ * TODO: we should improve on this, ideally using the Maven standard libraries (which are unfortunately baked into
+ * maven-core now)
+ */
+public final class MavenRepositoryMetadataReader
+{
+    private MavenRepositoryMetadataReader()
+    {
+    }
+
+    /**
+     * Read and return the {@link MavenRepositoryMetadata} object from the provided xml file.
+     *
+     * @param metadataFile the maven-metadata.xml file to read.
+     * @return the archiva repository metadata object that represents the provided file contents.
+     * @throws org.apache.maven.archiva.xml.XMLException
+     */
+    public static MavenRepositoryMetadata read( File metadataFile )
+        throws XMLException
+    {
+        XMLReader xml = new XMLReader( "metadata", metadataFile );
+        // invoke this to remove namespaces, see MRM-1136
+        xml.removeNamespaces();
+
+        MavenRepositoryMetadata metadata = new MavenRepositoryMetadata();
+
+        metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
+        metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
+        metadata.setVersion( xml.getElementText( "//metadata/version" ) );
+
+        metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) );
+        metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) );
+        metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) );
+        metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) );
+
+        Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" );
+        if ( snapshotElem != null )
+        {
+            MavenRepositoryMetadata.Snapshot snapshot = new MavenRepositoryMetadata.Snapshot();
+            snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) );
+            String tmp = snapshotElem.elementTextTrim( "buildNumber" );
+            if ( NumberUtils.isNumber( tmp ) )
+            {
+                snapshot.setBuildNumber( NumberUtils.toInt( tmp ) );
+            }
+            metadata.setSnapshotVersion( snapshot );
+        }
+
+        for ( Element plugin : xml.getElementList( "//metadata/plugins/plugin" ) )
+        {
+            MavenRepositoryMetadata.Plugin p = new MavenRepositoryMetadata.Plugin();
+            p.setPrefix( plugin.elementTextTrim( "prefix" ) );
+            p.setArtifactId( plugin.elementTextTrim( "artifactId" ) );
+            p.setName( plugin.elementTextTrim( "name" ) );
+            metadata.addPlugin( p );
+        }
+
+        return metadata;
+    }
+}
\ No newline at end of file
index 748b3b7ac0bf7e91deb6afb68cc3413031fb9e5a..b82c95c332b777b10c52dfbaacfe62bf0d950eac 100644 (file)
@@ -59,13 +59,13 @@ public class Maven2RepositoryMetadataResolverTest
         // TODO: more testing
     }
 
-//    public void testGetProjectVersionMetadataForTimestampedSnapshot()
-//    {
-//        ProjectVersionMetadata metadata =
-//            resolver.getProjectVersion( TEST_REPO_ID, "org.apache", "apache", "5-SNAPSHOT" );
-//        MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
-//        assertEquals( "jar", facet.getPackaging() );
-//        assertEquals( "http://www.apache.org/", metadata.getUrl() );
-//        // TODO: more testing
-//    }
+    public void testGetProjectVersionMetadataForTimestampedSnapshot()
+    {
+        ProjectVersionMetadata metadata =
+            resolver.getProjectVersion( TEST_REPO_ID, "org.apache", "apache", "5-SNAPSHOT" );
+        MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
+        assertEquals( "pom", facet.getPackaging() );
+        assertEquals( "http://www.apache.org/", metadata.getUrl() );
+        // TODO: more testing
+    }
 }
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReaderTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/MavenRepositoryMetadataReaderTest.java
new file mode 100644 (file)
index 0000000..b88036f
--- /dev/null
@@ -0,0 +1,73 @@
+package org.apache.archiva.metadata.repository.storage.maven2;
+
+/*
+ * 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 java.util.Arrays;
+
+import org.apache.maven.archiva.xml.XMLException;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
+/**
+ * RepositoryMetadataReaderTest
+ *
+ * @version $Id$
+ */
+public class MavenRepositoryMetadataReaderTest
+    extends PlexusInSpringTestCase
+{
+    public void testProjectMetadata()
+        throws XMLException
+    {
+        File defaultRepoDir = new File( getBasedir(), "src/test/repositories/test" );
+        File metadataFile = new File( defaultRepoDir, "org/apache/maven/shared/maven-downloader/maven-metadata.xml" );
+
+        MavenRepositoryMetadata metadata = MavenRepositoryMetadataReader.read( metadataFile );
+
+        assertNotNull( metadata );
+        assertEquals( "org.apache.maven.shared", metadata.getGroupId() );
+        assertEquals( "maven-downloader", metadata.getArtifactId() );
+        assertEquals( "1.1", metadata.getReleasedVersion() );
+        assertNull( metadata.getLatestVersion() );
+        assertEquals( Arrays.asList( "1.0", "1.1" ), metadata.getAvailableVersions() );
+        assertNull( metadata.getSnapshotVersion() );
+        assertEquals( "20061212214311", metadata.getLastUpdated() );
+    }
+
+    public void testProjectVersionMetadata()
+        throws XMLException
+    {
+        File defaultRepoDir = new File( getBasedir(), "src/test/repositories/test" );
+        File metadataFile = new File( defaultRepoDir, "org/apache/apache/5-SNAPSHOT/maven-metadata.xml" );
+
+        MavenRepositoryMetadata metadata = MavenRepositoryMetadataReader.read( metadataFile );
+
+        assertNotNull( metadata );
+        assertEquals( "org.apache", metadata.getGroupId() );
+        assertEquals( "apache", metadata.getArtifactId() );
+        assertNull( metadata.getReleasedVersion() );
+        assertNull( metadata.getLatestVersion() );
+        assertTrue( metadata.getAvailableVersions().isEmpty() );
+        assertNotNull( metadata.getSnapshotVersion() );
+        assertEquals( "20080801.151215", metadata.getSnapshotVersion().getTimestamp() );
+        assertEquals( 1, metadata.getSnapshotVersion().getBuildNumber() );
+        assertEquals( "20080801151215", metadata.getLastUpdated() );
+    }
+}
\ No newline at end of file
diff --git a/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/apache-5-20080801.151215-1.pom b/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/apache-5-20080801.151215-1.pom
new file mode 100644 (file)
index 0000000..df85cfa
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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>
+
+  <!-- Shared parent. Doesn't define a lot of things about Apache like general mailing lists, but does
+       define the settings common to all projects at Apache -->
+  <groupId>org.apache</groupId>
+  <artifactId>apache</artifactId>
+  <version>5-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <name>The Apache Software Foundation</name>
+  <description>
+    The Apache Software Foundation provides support for the Apache community of open-source software projects.
+    The Apache projects are characterized by a collaborative, consensus based development process, an open and
+    pragmatic software license, and a desire to create high quality software that leads the way in its field.
+    We consider ourselves not simply a group of projects sharing a server, but rather a community of developers
+    and users.
+  </description>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+  <organization>
+    <name>The Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <url>http://www.apache.org/</url>
+  <repositories>
+    <repository>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+  <distributionManagement>
+    <!-- Site omitted - each project must provide their own -->
+    <repository>
+      <id>apache.releases</id>
+      <name>Apache Release Distribution Repository</name>
+      <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+    </repository>
+    <snapshotRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+  </distributionManagement>
+  <mailingLists>
+    <mailingList>
+      <name>Apache Announce List</name>
+      <subscribe>announce-subscribe@apache.org</subscribe>
+      <unsubscribe>announce-unsubscribe@apache.org</unsubscribe>
+      <post>announce@apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/www-announce/</archive>
+    </mailingList>
+  </mailingLists>
+  <properties>
+    <organization.logo>http://www.apache.org/images/asf_logo_wide.gif</organization.logo>
+  </properties>
+  <!--
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-remote-resources-plugin</artifactId>
+        <configuration>
+          <artifacts>
+            <artifact>org.apache:apache-distribution-resources:1.0-SNAPSHOT</artifact>
+          </artifacts>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>process</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  -->
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/trunk/asf</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/trunk/asf</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/pom/trunk/asf</url>
+  </scm>
+</project>
+
diff --git a/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/maven-metadata.xml b/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/apache/5-SNAPSHOT/maven-metadata.xml
new file mode 100644 (file)
index 0000000..46dc46e
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<metadata>
+  <groupId>org.apache</groupId>
+  <artifactId>apache</artifactId>
+  <version>5-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <buildNumber>1</buildNumber>
+      <timestamp>20080801.151215</timestamp>
+    </snapshot>
+    <lastUpdated>20080801151215</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/maven/shared/maven-downloader/maven-metadata.xml b/archiva-modules/plugins/maven2-repository/src/test/repositories/test/org/apache/maven/shared/maven-downloader/maven-metadata.xml
new file mode 100644 (file)
index 0000000..5a7970a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ 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.
+  -->
+
+<metadata>
+  <groupId>org.apache.maven.shared</groupId>
+  <artifactId>maven-downloader</artifactId>
+  <version>1.0</version>
+  <versioning>
+    <release>1.1</release>
+    <versions>
+      <version>1.0</version>
+      <version>1.1</version>
+    </versions>
+    <lastUpdated>20061212214311</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/pom.xml b/pom.xml
index 5d647b7f7896256dd51cd142352b1af5eed3aa2f..f3a2754a5c60db9483414bbd1c63740adc2f8a4d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <artifactId>maven-model</artifactId>
         <version>${maven.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-model-builder</artifactId>
+        <version>${maven3x.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-repository-metadata</artifactId>
   </dependencyManagement>
   <properties>
     <maven.version>2.0.8</maven.version>
+    <maven3x.version>3.0-alpha-4</maven3x.version>
     <wagon.version>1.0-beta-5</wagon.version>
     <redback.version>1.2.2</redback.version>
     <jetty.version>6.1.19</jetty.version>