]> source.dussan.org Git - archiva.git/commitdiff
Updating with changes surrounding model, and database schema, change
authorJoakim Erdfelt <joakime@apache.org>
Thu, 5 Apr 2007 20:11:19 +0000 (20:11 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Thu, 5 Apr 2007 20:11:19 +0000 (20:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@525951 13f79535-47bb-0310-9956-ffa450edef68

72 files changed:
archiva-base/archiva-common/pom.xml
archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/BaseFileTest.java
archiva-base/archiva-consumers/archiva-database-consumers/pom.xml
archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java
archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java
archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java
archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/pom.xml
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReader.java
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel300Reader.java [deleted file]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel400Reader.java [deleted file]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilder.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpander.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/RepositoryProjectResolver.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/effective-poms/archiva-model-effective.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReaderTest.java
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/AllTests.java
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/ProjectModel400ReaderTest.java [deleted file]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/AllTests.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilderTest.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/AllTests.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java [deleted file]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site.xml [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site_en.xml [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom [new file with mode: 0644]
archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 [new file with mode: 0644]
archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java
archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java
archiva-consumer-api/pom.xml [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractConsumerTestCase.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractGenericConsumerTestCase.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AllTests.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/FileProblemsTracker.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/GenericArtifactConsumerTest.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockArtifactConsumer.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockModelConsumer.java [deleted file]
archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockRepositoryMetadataConsumer.java [deleted file]
archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java
archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java

index 17a20abd587f4911b7a916e41e87eff1467e6437..c5f3ff269855caa5497a228086ca6fe0fa6ac1e8 100644 (file)
          archiva-dev@maven.apache.org mailing-list.
             joakime@apache.org
       -->
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-api</artifactId>
-    </dependency>
-    <!-- 
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-    </dependency>
-      -->
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-container-default</artifactId>
index ab8c6718c2630b7e338b1768718741f433e5a71f..613e890126ac69fd28e6cf23ad6488c099a61bb4 100644 (file)
@@ -19,8 +19,9 @@ package org.apache.maven.archiva.common.utils;
  * under the License.
  */
 
+import org.apache.commons.lang.StringUtils;
+
 import junit.framework.TestCase;
-import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 
index 15df257bd6e4c3cb0006ec8c78b4de19b2fb86fe..32ab1336e54813a8fa30a1c1bfae06f578ef1528 100644 (file)
   <packaging>jar</packaging>
 
   <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.archiva</groupId>
       <artifactId>archiva-database</artifactId>
index 0ad7448bb319b556321ff3ad92dd2f32dc8b817e..69fee0c8567dad3d416887cf3af3f422ddefa7a6 100644 (file)
@@ -28,9 +28,10 @@ import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.model.RepositoryContent;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.layout.LayoutException;
+import org.codehaus.plexus.digest.Digester;
+import org.codehaus.plexus.digest.DigesterException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.registry.Registry;
@@ -38,6 +39,7 @@ import org.codehaus.plexus.registry.RegistryListener;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -50,13 +52,16 @@ import java.util.Map;
  * @plexus.component role-hint="update-db-artifact"
  *                   instantiation-strategy="per-lookup"
  */
-public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
+public class ArtifactUpdateDatabaseConsumer
+    extends AbstractMonitoredConsumer
     implements RepositoryContentConsumer, RegistryListener, Initializable
 {
     private static final String TYPE_NOT_ARTIFACT = "file-not-artifact";
 
     private static final String DB_ERROR = "db-error";
-    
+
+    private static final String CHECKSUM_CALCULATION = null;
+
     /**
      * @plexus.configuration default-value="update-db-artifact"
      */
@@ -66,7 +71,7 @@ public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
      * @plexus.configuration default-value="Update the Artifact in the Database"
      */
     private String description;
-    
+
     /**
      * @plexus.requirement role-hint="jdo"
      */
@@ -82,6 +87,16 @@ public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
      */
     private Map bidirectionalLayoutMap;
 
+    /**
+     * @plexus.requirement role-hint="sha1"
+     */
+    private Digester digestSha1;
+
+    /**
+     * @plexus.requirement role-hint="md5";
+     */
+    private Digester digestMd5;
+
     private ArchivaRepository repository;
 
     private File repositoryDir;
@@ -117,7 +132,8 @@ public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
         return this.includes;
     }
 
-    public void beginScan( ArchivaRepository repository ) throws ConsumerException
+    public void beginScan( ArchivaRepository repository )
+        throws ConsumerException
     {
         if ( !repository.isManaged() )
         {
@@ -131,31 +147,53 @@ public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
         if ( !bidirectionalLayoutMap.containsKey( layoutName ) )
         {
             throw new ConsumerException( "Unable to process repository with layout [" + layoutName
-                            + "] as there is no coresponding " + BidirectionalRepositoryLayout.class.getName()
-                            + " implementation available." );
+                + "] as there is no coresponding " + BidirectionalRepositoryLayout.class.getName()
+                + " implementation available." );
         }
 
         this.layout = (BidirectionalRepositoryLayout) bidirectionalLayoutMap.get( layoutName );
     }
 
-    public void processFile( String path ) throws ConsumerException
+    public void processFile( String path )
+        throws ConsumerException
     {
         try
         {
             ArchivaArtifact artifact = layout.toArtifact( path );
-            
-            RepositoryContent repoContent = artifact.getModel().getContentKey();
-            repoContent.setRepositoryId( this.repository.getId() );
-            
+
+            artifact.getModel().setRepositoryId( this.repository.getId() );
+
             // Calculate the hashcodes.
-            
-            
+            File artifactFile = new File( this.repositoryDir, path );
+            try
+            {
+                artifact.getModel().setChecksumMD5( digestMd5.calc( artifactFile ) );
+            }
+            catch ( DigesterException e )
+            {
+                triggerConsumerWarning( CHECKSUM_CALCULATION, "Unable to calculate the MD5 checksum: " + e.getMessage() );
+            }
+
+            try
+            {
+                artifact.getModel().setChecksumSHA1( digestSha1.calc( artifactFile ) );
+            }
+            catch ( DigesterException e )
+            {
+                triggerConsumerWarning( CHECKSUM_CALCULATION, "Unable to calculate the SHA1 checksum: "
+                    + e.getMessage() );
+            }
+
+            artifact.getModel().setLastModified( new Date( artifactFile.lastModified() ) );
+            artifact.getModel().setSize( artifactFile.length() );
+            artifact.getModel().setOrigin( "FileSystem" );
+
             dao.saveArtifact( artifact.getModel() );
         }
         catch ( LayoutException e )
         {
             triggerConsumerError( TYPE_NOT_ARTIFACT, "Path " + path + " cannot be converted to artifact: "
-                            + e.getMessage() );
+                + e.getMessage() );
         }
         catch ( ArchivaDatabaseException e )
         {
@@ -192,7 +230,8 @@ public class ArtifactUpdateDatabaseConsumer extends AbstractMonitoredConsumer
         }
     }
 
-    public void initialize() throws InitializationException
+    public void initialize()
+        throws InitializationException
     {
         propertyNameTriggers = new ArrayList();
         propertyNameTriggers.add( "repositoryScanning" );
index e3920f45c9fc0d9b9b61eaad3fb1353caa99d90a..34ce2e8fc1b531e290bb95180c79e619d24423a8 100644 (file)
@@ -71,7 +71,10 @@ public class ArchivaArtifact
         model.setGroupId( groupId );
         model.setArtifactId( artifactId );
         model.setVersion( version );
-        model.setRepositoryId( repository.getId() );
+        if ( repository != null )
+        {
+            model.setRepositoryId( repository.getId() );
+        }
         model.setClassifier( StringUtils.defaultString( classifier ) );
         model.setType( type );
 
index 8b50de8464ecf3af3292b74c02f748a70716016c..cdad4f850475b6fb530bf7f867cdfba4b7b219c2 100644 (file)
@@ -45,7 +45,7 @@ public class ArchivaModelCloner
         cloned.setGroupId( model.getGroupId() );
         cloned.setArtifactId( model.getArtifactId() );
         cloned.setVersion( model.getVersion() );
-        
+
         cloned.setParentProject( clone( model.getParentProject() ) );
 
         cloned.setName( model.getName() );
@@ -75,15 +75,15 @@ public class ArchivaModelCloner
         {
             return null;
         }
-        
+
         ArtifactReference cloned = new ArtifactReference();
-        
+
         cloned.setGroupId( artifactReference.getGroupId() );
         cloned.setArtifactId( artifactReference.getArtifactId() );
         cloned.setVersion( artifactReference.getVersion() );
         cloned.setClassifier( artifactReference.getClassifier() );
         cloned.setType( artifactReference.getType() );
-        
+
         return cloned;
     }
 
@@ -102,6 +102,30 @@ public class ArchivaModelCloner
         return cloned;
     }
 
+    public static Dependency clone( Dependency dependency )
+    {
+        if ( dependency == null )
+        {
+            return null;
+        }
+
+        Dependency cloned = new Dependency();
+
+        cloned.setGroupId( dependency.getGroupId() );
+        cloned.setArtifactId( dependency.getArtifactId() );
+        cloned.setVersion( dependency.getVersion() );
+
+        cloned.setClassifier( dependency.getClassifier() );
+        cloned.setType( dependency.getType() );
+        cloned.setScope( dependency.getScope() );
+        cloned.setOptional( dependency.isOptional() );
+        cloned.setSystemPath( dependency.getSystemPath() );
+        cloned.setUrl( dependency.getUrl() );
+        cloned.setExclusions( cloneExclusions( dependency.getExclusions() ) );
+
+        return cloned;
+    }
+
     public static IssueManagement clone( IssueManagement issueManagement )
     {
         if ( issueManagement == null )
@@ -175,13 +199,13 @@ public class ArchivaModelCloner
         {
             return null;
         }
-        
+
         VersionedReference cloned = new VersionedReference();
-        
+
         cloned.setGroupId( versionedReference.getGroupId() );
         cloned.setArtifactId( versionedReference.getArtifactId() );
         cloned.setVersion( versionedReference.getVersion() );
-        
+
         return cloned;
     }
 
@@ -217,21 +241,13 @@ public class ArchivaModelCloner
         while ( it.hasNext() )
         {
             Dependency dep = (Dependency) it.next();
-            Dependency cloned = new Dependency();
-            
-            cloned.setGroupId( dep.getGroupId() );
-            cloned.setArtifactId( dep.getArtifactId() );
-            cloned.setVersion( dep.getVersion() );
-            
-            cloned.setClassifier( dep.getClassifier() );
-            cloned.setType( dep.getType() );
-            cloned.setScope( dep.getScope() );
-            cloned.setOptional( dep.isOptional() );
-            cloned.setSystemPath( dep.getSystemPath() );
-            cloned.setUrl( dep.getUrl() );
-            cloned.setExclusions( cloneExclusions( dep.getExclusions() ) );
 
-            ret.add( cloned );
+            Dependency cloned = clone( dep );
+
+            if ( cloned != null )
+            {
+                ret.add( cloned );
+            }
         }
 
         return ret;
diff --git a/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java b/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java
new file mode 100644 (file)
index 0000000..263cd32
--- /dev/null
@@ -0,0 +1,60 @@
+package org.apache.maven.archiva.model;
+
+/*
+ * 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 org.codehaus.plexus.PlexusTestCase;
+
+/**
+ * ArchivaModelClonerTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ArchivaModelClonerTest
+    extends PlexusTestCase
+{
+    public void testCloneProjectModelWithParent()
+    {
+        ArchivaProjectModel actualModel = new ArchivaProjectModel();
+        actualModel.setGroupId( null );
+        actualModel.setArtifactId( "archiva-common" );
+        actualModel.setVersion( null );
+        actualModel.setParentProject( new VersionedReference() );
+        actualModel.getParentProject().setGroupId( "org.apache.maven.archiva" );
+        actualModel.getParentProject().setArtifactId( "archiva-parent" );
+        actualModel.getParentProject().setVersion( "1.0" );
+
+        ArchivaProjectModel clonedModel = ArchivaModelCloner.clone( actualModel );
+
+        // Should not be the same object (in memory)
+        assertNotSame( clonedModel, actualModel );
+
+        // Should be equal in value.
+        assertEquals( clonedModel, actualModel );
+
+        // Test specific fields.
+        assertNull( "Group Id", clonedModel.getGroupId() );
+        assertNull( "Version", clonedModel.getVersion() );
+        assertNotNull( "Parent Reference", clonedModel.getParentProject() );
+        assertEquals( "Parent Group Id", "org.apache.maven.archiva", clonedModel.getParentProject().getGroupId() );
+        assertEquals( "Parent Artifact Id", "archiva-parent", clonedModel.getParentProject().getArtifactId() );
+        assertEquals( "Parent Version", "1.0", clonedModel.getParentProject().getVersion() );
+    }
+}
index 6ec87f43116fa29d5fa1cd5fa5e551e040f192c4..33b2aaee9b0d6fa271f2eda366c7e18ca67491b7 100644 (file)
       <artifactId>archiva-xml-tools</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-expression-evaluator</artifactId>
+      <version>1.0-alpha-1</version>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
index 659a7de678cf1169693f89469515e5efef3b290a..795c3a2c1578b2684639c8371682955be9389c6e 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.maven.archiva.repository.metadata;
  */
 
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.RepositoryContent;
 import org.apache.maven.archiva.xml.XMLException;
 import org.apache.maven.archiva.xml.XMLReader;
 
@@ -49,13 +48,9 @@ public class RepositoryMetadataReader
             XMLReader xml = new XMLReader( "metadata", metadataFile );
 
             ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata();
-
-            RepositoryContent contentKey = new RepositoryContent();
-            contentKey.setGroupId( xml.getElementText( "//metadata/groupId" ) );
-            contentKey.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
             
-            metadata.setContentKey( contentKey );
-
+            metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) );
+            metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) );
             metadata.setLastModified( new Date( metadataFile.lastModified() ) );
             metadata.setSize( metadataFile.length() );
             metadata.setWhenIndexed( new Date() );
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel300Reader.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel300Reader.java
deleted file mode 100644 (file)
index 1cb9d86..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.maven.archiva.repository.project;
-
-/*
- * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
-
-import java.io.File;
-
-/**
- * ProjectModel300Reader 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class ProjectModel300Reader implements ProjectModelReader
-{
-
-    public ArchivaProjectModel read( File pomFile )
-    throws ProjectModelException
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel400Reader.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModel400Reader.java
deleted file mode 100644 (file)
index 0e64d11..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-package org.apache.maven.archiva.repository.project;
-
-/*
- * 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 org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.apache.maven.archiva.model.CiManagement;
-import org.apache.maven.archiva.model.Dependency;
-import org.apache.maven.archiva.model.DependencyScope;
-import org.apache.maven.archiva.model.Exclusion;
-import org.apache.maven.archiva.model.Individual;
-import org.apache.maven.archiva.model.IssueManagement;
-import org.apache.maven.archiva.model.License;
-import org.apache.maven.archiva.model.Organization;
-import org.apache.maven.archiva.model.ProjectRepository;
-import org.apache.maven.archiva.model.RepositoryContent;
-import org.apache.maven.archiva.model.Scm;
-import org.apache.maven.archiva.xml.XMLException;
-import org.apache.maven.archiva.xml.XMLReader;
-import org.dom4j.Element;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * ProjectModel400Reader 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class ProjectModel400Reader implements ProjectModelReader
-{
-
-    public ArchivaProjectModel read( File pomFile ) throws ProjectModelException
-    {
-        try
-        {
-            XMLReader xml = new XMLReader( "project", pomFile );
-
-            ArchivaProjectModel model = new ArchivaProjectModel();
-
-            RepositoryContent contentKey = new RepositoryContent();
-            contentKey.setGroupId( xml.getElementText( "//project/groupId" ) );
-            contentKey.setArtifactId( xml.getElementText( "//project/artifactId" ) );
-            contentKey.setVersion( xml.getElementText( "//project/version" ) );
-            model.setContentKey( contentKey );
-
-            model.setName( xml.getElementText( "//project/name" ) );
-            model.setDescription( xml.getElementText( "//project/description" ) );
-            model.setUrl( xml.getElementText( "//project/url" ) );
-            model.setPackaging( StringUtils.defaultIfEmpty( xml.getElementText( "//project/packaging" ), "jar" ) );
-
-            model.setParentContentKey( getParentContentKey( xml ) );
-
-            model.setCiManagement( getCiManagement( xml ) );
-            model.setIndividuals( getIndividuals( xml ) );
-            model.setIssueManagement( getIssueManagement( xml ) );
-            model.setLicenses( getLicenses( xml ) );
-            model.setOrganization( getOrganization( xml ) );
-            model.setScm( getSCM( xml ) );
-            model.setRepositories( getRepositories( xml ) );
-
-            model.setDependencies( getDependencies( xml ) );
-            model.setPlugins( getPlugins( xml ) );
-            model.setReports( getReports( xml ) );
-
-            return model;
-        }
-        catch ( XMLException e )
-        {
-            throw new ProjectModelException( e.getMessage(), e );
-        }
-    }
-
-    private CiManagement getCiManagement( XMLReader xml ) throws XMLException
-    {
-        Element elemCiMgmt = xml.getElement( "//project/ciManagement" );
-        if ( elemCiMgmt != null )
-        {
-            CiManagement ciManagement = new CiManagement();
-            ciManagement.setSystem( elemCiMgmt.elementTextTrim( "system" ) );
-            ciManagement.setUrl( elemCiMgmt.elementTextTrim( "url" ) );
-            return ciManagement;
-        }
-
-        return null;
-    }
-
-    private List getDependencies( XMLReader xml ) throws XMLException
-    {
-        List dependencies = new ArrayList();
-
-        Iterator it = xml.getElementList( "//project/dependencies/dependency" ).iterator();
-        while ( it.hasNext() )
-        {
-            Element elemDependency = (Element) it.next();
-            Dependency dependency = new Dependency();
-
-            dependency.setContentKey( getContentKey( elemDependency ) );
-
-            dependency.setClassifier( elemDependency.elementTextTrim( "classifier" ) );
-            dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) );
-            dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) );
-            // Not for v4.0.0 -> dependency.setUrl( elemDependency.elementTextTrim( "url" ) );
-            dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) );
-            if ( DependencyScope.isSystemScoped( dependency ) )
-            {
-                dependency.setSystemPath( elemDependency.elementTextTrim( "systemPath" ) );
-            }
-
-            dependency.setExclusions( getExclusions( elemDependency ) );
-
-            dependencies.add( dependency );
-        }
-
-        return dependencies;
-    }
-
-    private List getExclusions( Element elemDependency )
-    {
-        List exclusions = new ArrayList();
-
-        Element elemExclusions = elemDependency.element( "exclusions" );
-
-        if ( elemExclusions != null )
-        {
-            Iterator it = elemExclusions.elementIterator( "exclusion" );
-            while ( it.hasNext() )
-            {
-                Element elemExclusion = (Element) it.next();
-                Exclusion exclusion = new Exclusion();
-
-                exclusion.setGroupId( elemExclusion.elementTextTrim( "groupId" ) );
-                exclusion.setArtifactId( elemExclusion.elementTextTrim( "artifactId" ) );
-
-                exclusions.add( exclusion );
-            }
-        }
-
-        return exclusions;
-    }
-
-    private List getIndividuals( XMLReader xml ) throws XMLException
-    {
-        List individuals = new ArrayList();
-
-        individuals.addAll( getIndividuals( xml, true, "//project/developers/developer" ) );
-        individuals.addAll( getIndividuals( xml, false, "//project/contributors/contributor" ) );
-
-        return individuals;
-    }
-
-    private List getIndividuals( XMLReader xml, boolean isCommitor, String xpathExpr ) throws XMLException
-    {
-        List ret = new ArrayList();
-
-        List modelPersonList = xml.getElementList( xpathExpr );
-
-        Iterator iter = modelPersonList.iterator();
-        while ( iter.hasNext() )
-        {
-            Element elemPerson = (Element) iter.next();
-            Individual individual = new Individual();
-
-            individual.setCommitor( isCommitor );
-            individual.setEmail( elemPerson.elementTextTrim( "email" ) );
-            individual.setName( elemPerson.elementTextTrim( "name" ) );
-            individual.setOrganization( elemPerson.elementTextTrim( "organization" ) );
-            individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) );
-            individual.setUrl( elemPerson.elementTextTrim( "url" ) );
-            individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) );
-
-            // Roles
-            Element elemRoles = elemPerson.element( "roles" );
-            if ( elemRoles != null )
-            {
-                List roleNames = elemRoles.elements( "role" );
-                Iterator itRole = roleNames.iterator();
-                while ( itRole.hasNext() )
-                {
-                    Element role = (Element) itRole.next();
-                    individual.addRole( role.getTextTrim() );
-                }
-            }
-
-            // Properties
-            Element elemProperties = elemPerson.element( "properties" );
-            if ( elemProperties != null )
-            {
-                Iterator itProps = elemProperties.elements().iterator();
-                while ( itProps.hasNext() )
-                {
-                    Element elemProp = (Element) itProps.next();
-                    individual.addProperty( elemProp.getName(), elemProp.getText() );
-                }
-            }
-
-            ret.add( individual );
-        }
-
-        return ret;
-    }
-
-    private IssueManagement getIssueManagement( XMLReader xml ) throws XMLException
-    {
-        Element elemIssueMgmt = xml.getElement( "//project/issueManagement" );
-        if ( elemIssueMgmt != null )
-        {
-            IssueManagement issueMgmt = new IssueManagement();
-
-            issueMgmt.setSystem( elemIssueMgmt.elementTextTrim( "system" ) );
-            issueMgmt.setUrl( elemIssueMgmt.elementTextTrim( "url" ) );
-
-            return issueMgmt;
-        }
-
-        return null;
-    }
-
-    private List getLicenses( XMLReader xml ) throws XMLException
-    {
-        List licenses = new ArrayList();
-
-        Element elemLicenses = xml.getElement( "//project/licenses" );
-
-        if ( elemLicenses != null )
-        {
-            Iterator itLicense = elemLicenses.elements( "license" ).iterator();
-            while ( itLicense.hasNext() )
-            {
-                Element elemLicense = (Element) itLicense.next();
-                License license = new License();
-
-                // TODO: Create LicenseIdentity class to managed license ids.
-                // license.setId( elemLicense.elementTextTrim( "id" ) );
-                license.setName( elemLicense.elementTextTrim( "name" ) );
-                license.setUrl( elemLicense.elementTextTrim( "url" ) );
-                license.setComments( elemLicense.elementTextTrim( "comments" ) );
-
-                licenses.add( license );
-            }
-        }
-
-        return licenses;
-    }
-
-    private Organization getOrganization( XMLReader xml ) throws XMLException
-    {
-        Element elemOrg = xml.getElement( "//project/organization" );
-        if ( elemOrg != null )
-        {
-            Organization org = new Organization();
-
-            org.setName( elemOrg.elementTextTrim( "name" ) );
-            org.setUrl( elemOrg.elementTextTrim( "url" ) );
-
-            return org;
-        }
-
-        return null;
-    }
-
-    private RepositoryContent getParentContentKey( XMLReader xml ) throws XMLException
-    {
-        Element elemParent = xml.getElement( "//project/parent" );
-
-        if ( elemParent != null )
-        {
-            return getContentKey( elemParent );
-        }
-
-        return null;
-    }
-
-    private RepositoryContent getContentKey( Element elem )
-    {
-        RepositoryContent contentKey = new RepositoryContent();
-
-        contentKey.setGroupId( elem.elementTextTrim( "groupId" ) );
-        contentKey.setArtifactId( elem.elementTextTrim( "artifactId" ) );
-        contentKey.setVersion( elem.elementTextTrim( "version" ) );
-
-        return contentKey;
-    }
-
-    private List getPlugins( XMLReader xml ) throws XMLException
-    {
-        return getPlugins( xml, "//project/build/plugins/plugin" );
-    }
-
-    private List getReports( XMLReader xml ) throws XMLException
-    {
-        return getPlugins( xml, "//project/reporting/plugins/plugin" );
-    }
-
-    /**
-     * Get List of {@link RepositoryContent} objects from plugin definitions.
-     */
-    private List getPlugins( XMLReader xml, String xpathExpr ) throws XMLException
-    {
-        List plugins = new ArrayList();
-
-        Iterator it = xml.getElementList( xpathExpr ).iterator();
-        while ( it.hasNext() )
-        {
-            Element elemPlugin = (Element) it.next();
-
-            plugins.add( getContentKey( elemPlugin ) );
-        }
-
-        return plugins;
-    }
-
-    private List getRepositories( XMLReader xml ) throws XMLException
-    {
-        List repos = new ArrayList();
-
-        repos.addAll( getRepositories( xml, false, "//project/repositories/repository" ) );
-        repos.addAll( getRepositories( xml, true, "//project/pluginRepositories/pluginRepository" ) );
-
-        return repos;
-    }
-
-    private List getRepositories( XMLReader xml, boolean isPluginRepo, String xpathExpr ) throws XMLException
-    {
-        List ret = new ArrayList();
-
-        List repositoriesList = xml.getElementList( xpathExpr );
-
-        Iterator itRepos = repositoriesList.iterator();
-        while ( itRepos.hasNext() )
-        {
-            Element elemRepo = (Element) itRepos.next();
-            ProjectRepository repo = new ProjectRepository();
-
-            repo.setId( elemRepo.elementTextTrim( "id" ) );
-            repo.setName( elemRepo.elementTextTrim( "name" ) );
-            repo.setUrl( elemRepo.elementTextTrim( "url" ) );
-            repo.setLayout( StringUtils.defaultIfEmpty( elemRepo.elementTextTrim( "layout" ), "default" ) );
-            repo.setPlugins( isPluginRepo );
-
-            repo.setReleases( toBoolean( xml.getElementText( elemRepo, "releases/enabled" ), true ) );
-            repo.setReleases( toBoolean( xml.getElementText( elemRepo, "snapshots/enabled" ), false ) );
-
-            ret.add( repo );
-        }
-
-        return ret;
-    }
-
-    private Scm getSCM( XMLReader xml ) throws XMLException
-    {
-        Element elemScm = xml.getElement( "//project/scm" );
-
-        if ( elemScm != null )
-        {
-            Scm scm = new Scm();
-
-            scm.setConnection( elemScm.elementTextTrim( "connection" ) );
-            scm.setDeveloperConnection( elemScm.elementTextTrim( "developerConnection" ) );
-            scm.setUrl( elemScm.elementTextTrim( "url" ) );
-
-            return scm;
-        }
-
-        return null;
-    }
-
-    private boolean toBoolean( String value, boolean defaultValue )
-    {
-        if ( StringUtils.equalsIgnoreCase( value, "true" ) )
-        {
-            return true;
-        }
-        else if ( StringUtils.equalsIgnoreCase( value, "false" ) )
-        {
-            return false;
-        }
-        else
-        {
-            // If unset, or not "true" or "false".
-            return defaultValue;
-        }
-    }
-
-}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java
new file mode 100644 (file)
index 0000000..e009433
--- /dev/null
@@ -0,0 +1,39 @@
+package org.apache.maven.archiva.repository.project;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+
+/**
+ * Generic Filtering interface for {@link ArchivaProjectModel} objects.  
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface ProjectModelFilter
+{
+    /**
+     * Filter a model and return the results of the filtering.
+     * 
+     * @param model the model to filter.
+     * @return a new model representing the filtered state of the model.
+     */
+    public ArchivaProjectModel filter( final ArchivaProjectModel model );
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java
new file mode 100644 (file)
index 0000000..ba32cf4
--- /dev/null
@@ -0,0 +1,661 @@
+package org.apache.maven.archiva.repository.project;
+
+/*
+ * 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 org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.model.ArchivaModelCloner;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.model.CiManagement;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.Exclusion;
+import org.apache.maven.archiva.model.Individual;
+import org.apache.maven.archiva.model.IssueManagement;
+import org.apache.maven.archiva.model.License;
+import org.apache.maven.archiva.model.Organization;
+import org.apache.maven.archiva.model.ProjectRepository;
+import org.apache.maven.archiva.model.Scm;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+/**
+ * ProjectModelMerge
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProjectModelMerge
+{
+    /**
+     * Merge the contents of a project with it's parent project.
+     * 
+     * @param mainProject the main project.
+     * @param parentProject the parent project to merge.
+     * @throws ProjectModelException if there was a problem merging the model.
+     */
+    public static ArchivaProjectModel merge( ArchivaProjectModel mainProject, ArchivaProjectModel parentProject )
+        throws ProjectModelException
+    {
+        System.out.println( "## Merging: " + mainProject + " with " + parentProject );
+        if ( mainProject == null )
+        {
+            throw new ProjectModelException( "Cannot copy a null main project." );
+        }
+
+        if ( parentProject == null )
+        {
+            throw new ProjectModelException( "Cannot copy to a null parent project." );
+        }
+
+        ArchivaProjectModel merged = new ArchivaProjectModel();
+
+        // Unmerged.
+        merged.setArtifactId( mainProject.getArtifactId() );
+        merged.setPackaging( StringUtils.defaultIfEmpty( mainProject.getPackaging(), "jar" ) );
+
+        // Merged
+        merged.setGroupId( merge( mainProject.getGroupId(), parentProject.getGroupId() ) );
+        merged.setVersion( merge( mainProject.getVersion(), parentProject.getVersion() ) );
+        merged.setName( merge( mainProject.getName(), parentProject.getName() ) );
+        merged.setUrl( merge( mainProject.getUrl(), parentProject.getUrl() ) );
+        merged.setDescription( merge( mainProject.getDescription(), parentProject.getDescription() ) );
+
+        merged.setOrigin( "merged" );
+
+        merged.setCiManagement( merge( mainProject.getCiManagement(), parentProject.getCiManagement() ) );
+        merged.setIndividuals( mergeIndividuals( mainProject.getIndividuals(), parentProject.getIndividuals() ) );
+        merged.setIssueManagement( merge( mainProject.getIssueManagement(), parentProject.getIssueManagement() ) );
+        merged.setLicenses( mergeLicenses( mainProject.getLicenses(), parentProject.getLicenses() ) );
+        merged.setOrganization( merge( mainProject.getOrganization(), parentProject.getOrganization() ) );
+        merged.setScm( merge( mainProject.getScm(), parentProject.getScm() ) );
+        merged.setRepositories( mergeRepositories( mainProject.getRepositories(), parentProject.getRepositories() ) );
+        merged.setDependencies( mergeDependencies( mainProject.getDependencies(), parentProject.getDependencies() ) );
+        merged.setDependencyManagement( mergeDependencyManagement( mainProject.getDependencyManagement(), parentProject
+            .getDependencyManagement() ) );
+        merged.setPlugins( mergePlugins( mainProject.getPlugins(), parentProject.getPlugins() ) );
+        merged.setReports( mergeReports( mainProject.getReports(), parentProject.getReports() ) );
+        merged.setProperties( merge( mainProject.getProperties(), parentProject.getProperties() ) );
+
+        return merged;
+    }
+
+    private static Map createArtifactReferenceMap( List artifactReferences )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = artifactReferences.iterator();
+        while ( it.hasNext() )
+        {
+            ArtifactReference artifactReference = (ArtifactReference) it.next();
+            String key = toVersionlessArtifactKey( artifactReference );
+            ret.put( key, artifactReference );
+        }
+
+        return ret;
+    }
+
+    private static Map createDependencyMap( List dependencies )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = dependencies.iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dep = (Dependency) it.next();
+            String key = toVersionlessDependencyKey( dep );
+            ret.put( key, dep );
+        }
+
+        return ret;
+    }
+
+    private static Map createExclusionMap( List exclusions )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = exclusions.iterator();
+        while ( it.hasNext() )
+        {
+            Exclusion exclusion = (Exclusion) it.next();
+            String key = exclusion.getGroupId() + ":" + exclusion.getArtifactId();
+            ret.put( key, exclusion );
+        }
+
+        return ret;
+    }
+
+    private static Map createLicensesMap( List licenses )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = licenses.iterator();
+        while ( it.hasNext() )
+        {
+            License license = (License) it.next();
+            // TODO: Change to 'id' when LicenseTypeMapper is created.
+            String key = license.getName();
+            ret.put( key, license );
+        }
+
+        return ret;
+    }
+
+    private static Map createRepositoriesMap( List repositories )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = repositories.iterator();
+        while ( it.hasNext() )
+        {
+            ProjectRepository repo = (ProjectRepository) it.next();
+            // Should this really be using repo.id ?
+            String key = repo.getUrl();
+            ret.put( key, repo );
+        }
+
+        return ret;
+    }
+
+    private static boolean empty( String val )
+    {
+        if ( val == null )
+        {
+            return true;
+        }
+
+        return ( val.trim().length() <= 0 );
+    }
+
+    private static ArtifactReference merge( ArtifactReference mainArtifactReference,
+                                            ArtifactReference parentArtifactReference )
+    {
+        if ( parentArtifactReference == null )
+        {
+            return mainArtifactReference;
+        }
+
+        if ( mainArtifactReference == null )
+        {
+            return ArchivaModelCloner.clone( parentArtifactReference );
+        }
+
+        ArtifactReference merged = new ArtifactReference();
+
+        // Unmerged.
+        merged.setGroupId( mainArtifactReference.getGroupId() );
+        merged.setArtifactId( mainArtifactReference.getArtifactId() );
+
+        // Merged.
+        merged.setVersion( merge( mainArtifactReference.getVersion(), parentArtifactReference.getVersion() ) );
+        merged.setClassifier( merge( mainArtifactReference.getClassifier(), parentArtifactReference.getClassifier() ) );
+        merged.setType( merge( mainArtifactReference.getType(), parentArtifactReference.getType() ) );
+
+        return merged;
+    }
+
+    private static CiManagement merge( CiManagement mainCim, CiManagement parentCim )
+    {
+        if ( parentCim == null )
+        {
+            return mainCim;
+        }
+
+        if ( mainCim == null )
+        {
+            return ArchivaModelCloner.clone( parentCim );
+        }
+
+        CiManagement merged = new CiManagement();
+
+        merged.setSystem( merge( mainCim.getSystem(), parentCim.getSystem() ) );
+        merged.setUrl( merge( mainCim.getUrl(), parentCim.getUrl() ) );
+
+        return merged;
+    }
+
+    private static Dependency merge( Dependency mainDep, Dependency parentDep )
+    {
+        if ( parentDep == null )
+        {
+            return mainDep;
+        }
+
+        if ( mainDep == null )
+        {
+            return ArchivaModelCloner.clone( parentDep );
+        }
+
+        Dependency merged = new Dependency();
+
+        // Unmerged.
+        merged.setGroupId( mainDep.getGroupId() );
+        merged.setArtifactId( mainDep.getArtifactId() );
+
+        // Merged.
+        merged.setVersion( merge( mainDep.getVersion(), parentDep.getVersion() ) );
+        merged.setClassifier( merge( mainDep.getClassifier(), parentDep.getClassifier() ) );
+        merged.setType( merge( mainDep.getType(), parentDep.getType() ) );
+        merged.setScope( merge( mainDep.getScope(), parentDep.getScope() ) );
+        if ( parentDep.isOptional() )
+        {
+            merged.setOptional( true );
+        }
+
+        merged.setSystemPath( merge( mainDep.getSystemPath(), parentDep.getSystemPath() ) );
+        merged.setUrl( merge( mainDep.getUrl(), parentDep.getUrl() ) );
+        merged.setExclusions( mergeExclusions( mainDep.getExclusions(), parentDep.getExclusions() ) );
+
+        return merged;
+    }
+
+    private static IssueManagement merge( IssueManagement mainIssueManagement, IssueManagement parentIssueManagement )
+    {
+        if ( parentIssueManagement == null )
+        {
+            return mainIssueManagement;
+        }
+
+        if ( mainIssueManagement == null )
+        {
+            return ArchivaModelCloner.clone( parentIssueManagement );
+        }
+
+        IssueManagement merged = new IssueManagement();
+
+        merged.setSystem( merge( mainIssueManagement.getSystem(), parentIssueManagement.getSystem() ) );
+        merged.setUrl( merge( mainIssueManagement.getUrl(), parentIssueManagement.getUrl() ) );
+
+        return merged;
+    }
+
+    private static Organization merge( Organization mainOrganization, Organization parentOrganization )
+    {
+        if ( parentOrganization == null )
+        {
+            return mainOrganization;
+        }
+
+        if ( mainOrganization == null )
+        {
+            return ArchivaModelCloner.clone( parentOrganization );
+        }
+
+        Organization merged = new Organization();
+
+        merged.setFavicon( merge( mainOrganization.getFavicon(), parentOrganization.getFavicon() ) );
+        merged.setName( merge( mainOrganization.getName(), parentOrganization.getName() ) );
+        merged.setUrl( merge( mainOrganization.getUrl(), parentOrganization.getUrl() ) );
+
+        return merged;
+    }
+
+    private static Properties merge( Properties mainProperties, Properties parentProperties )
+    {
+        if ( parentProperties == null )
+        {
+            return mainProperties;
+        }
+
+        if ( mainProperties == null )
+        {
+            return ArchivaModelCloner.clone( parentProperties );
+        }
+
+        Properties merged = new Properties();
+
+        Enumeration keys = parentProperties.propertyNames();
+        while ( keys.hasMoreElements() )
+        {
+            String key = (String) keys.nextElement();
+            merged.put( key, merge( mainProperties.getProperty( key ), parentProperties.getProperty( key ) ) );
+        }
+
+        return merged;
+    }
+
+    private static Scm merge( Scm mainScm, Scm parentScm )
+    {
+        if ( parentScm == null )
+        {
+            return mainScm;
+        }
+
+        if ( mainScm == null )
+        {
+            return ArchivaModelCloner.clone( parentScm );
+        }
+
+        Scm merged = new Scm();
+
+        merged.setConnection( merge( mainScm.getConnection(), parentScm.getConnection() ) );
+        merged.setDeveloperConnection( merge( mainScm.getDeveloperConnection(), parentScm.getDeveloperConnection() ) );
+        merged.setUrl( merge( mainScm.getUrl(), parentScm.getUrl() ) );
+
+        return merged;
+    }
+
+    private static String merge( String main, String parent )
+    {
+        if ( empty( main ) && !empty( parent ) )
+        {
+            return parent;
+        }
+
+        return main;
+    }
+
+    private static List mergeArtifactReferences( List mainArtifactReferences, List parentArtifactReferences )
+    {
+        if ( parentArtifactReferences == null )
+        {
+            return mainArtifactReferences;
+        }
+
+        if ( mainArtifactReferences == null )
+        {
+            return ArchivaModelCloner.cloneLicenses( parentArtifactReferences );
+        }
+
+        List merged = new ArrayList();
+
+        Map mainArtifactReferenceMap = createArtifactReferenceMap( mainArtifactReferences );
+        Map parentArtifactReferenceMap = createArtifactReferenceMap( parentArtifactReferences );
+
+        Iterator it = mainArtifactReferenceMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            ArtifactReference mainArtifactReference = (ArtifactReference) entry.getValue();
+            ArtifactReference parentArtifactReference = (ArtifactReference) parentArtifactReferenceMap.get( key );
+
+            if ( parentArtifactReference == null )
+            {
+                merged.add( mainArtifactReference );
+            }
+            else
+            {
+                // Not merging. Local wins.
+                merged.add( merge( mainArtifactReference, parentArtifactReference ) );
+            }
+        }
+
+        return merged;
+    }
+
+    private static List mergeDependencies( List mainDependencies, List parentDependencies )
+    {
+        if ( parentDependencies == null )
+        {
+            return mainDependencies;
+        }
+
+        if ( mainDependencies == null )
+        {
+            return ArchivaModelCloner.cloneDependencies( parentDependencies );
+        }
+
+        List merged = ArchivaModelCloner.cloneDependencies( mainDependencies );
+
+        Map mainDepMap = createDependencyMap( mainDependencies );
+        Map parentDepMap = createDependencyMap( parentDependencies );
+
+        Iterator it = parentDepMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            Dependency parentDep = (Dependency) entry.getValue();
+            Dependency mainDep = (Dependency) mainDepMap.get( key );
+
+            if ( parentDep == null )
+            {
+                merged.add( mainDep );
+            }
+            else
+            {
+                merged.add( merge( mainDep, parentDep ) );
+            }
+        }
+
+        return merged;
+    }
+
+    private static List mergeDependencyManagement( List mainDepMgmt, List parentDepMgmt )
+    {
+        if ( parentDepMgmt == null )
+        {
+            return mainDepMgmt;
+        }
+
+        if ( mainDepMgmt == null )
+        {
+            return ArchivaModelCloner.cloneDependencies( parentDepMgmt );
+        }
+
+        List merged = ArchivaModelCloner.cloneDependencies( mainDepMgmt );
+
+        Map mainDepMap = createDependencyMap( mainDepMgmt );
+        Map parentDepMap = createDependencyMap( parentDepMgmt );
+
+        Iterator it = parentDepMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            Dependency parentDep = (Dependency) entry.getValue();
+            Dependency mainDep = (Dependency) mainDepMap.get( key );
+
+            if ( parentDep == null )
+            {
+                merged.add( mainDep );
+            }
+            else
+            {
+                merged.add( merge( mainDep, parentDep ) );
+            }
+        }
+
+        return merged;
+    }
+
+    public static List mergeExclusions( List mainExclusions, List parentExclusions )
+    {
+        if ( parentExclusions == null )
+        {
+            return mainExclusions;
+        }
+
+        if ( mainExclusions == null )
+        {
+            return ArchivaModelCloner.cloneExclusions( parentExclusions );
+        }
+
+        List merged = new ArrayList();
+
+        Map mainExclusionMap = createExclusionMap( mainExclusions );
+        Map parentExclusionMap = createExclusionMap( parentExclusions );
+
+        Iterator it = mainExclusionMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            Exclusion mainExclusion = (Exclusion) entry.getValue();
+            Exclusion parentExclusion = (Exclusion) parentExclusionMap.get( key );
+
+            if ( parentExclusion == null )
+            {
+                merged.add( mainExclusion );
+            }
+            else
+            {
+                merged.add( parentExclusion );
+            }
+        }
+
+        return merged;
+    }
+
+    private static List mergeIndividuals( List mainIndividuals, List parentIndividuals )
+    {
+        if ( parentIndividuals == null )
+        {
+            return mainIndividuals;
+        }
+
+        if ( mainIndividuals == null )
+        {
+            return ArchivaModelCloner.cloneIndividuals( parentIndividuals );
+        }
+
+        List merged = ArchivaModelCloner.cloneIndividuals( mainIndividuals );
+
+        Iterator it = parentIndividuals.iterator();
+        while ( it.hasNext() )
+        {
+            Individual parentIndividual = (Individual) it.next();
+
+            if ( !mainIndividuals.contains( parentIndividual ) )
+            {
+                merged.add( parentIndividual );
+            }
+        }
+
+        return merged;
+    }
+
+    private static List mergeLicenses( List mainLicenses, List parentLicenses )
+    {
+        if ( parentLicenses == null )
+        {
+            return mainLicenses;
+        }
+
+        if ( mainLicenses == null )
+        {
+            return ArchivaModelCloner.cloneLicenses( parentLicenses );
+        }
+
+        List merged = new ArrayList();
+
+        Map mainLicensesMap = createLicensesMap( mainLicenses );
+        Map parentLicensesMap = createLicensesMap( parentLicenses );
+
+        Iterator it = mainLicensesMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            License mainLicense = (License) entry.getValue();
+            License parentLicense = (License) parentLicensesMap.get( key );
+
+            if ( parentLicense == null )
+            {
+                merged.add( mainLicense );
+            }
+            else
+            {
+                // Not merging. Local wins.
+                merged.add( parentLicense );
+            }
+        }
+
+        return merged;
+    }
+
+    private static List mergePlugins( List mainPlugins, List parentPlugins )
+    {
+        return mergeArtifactReferences( mainPlugins, parentPlugins );
+    }
+
+    private static List mergeReports( List mainReports, List parentReports )
+    {
+        return mergeArtifactReferences( mainReports, parentReports );
+    }
+
+    private static List mergeRepositories( List mainRepositories, List parentRepositories )
+    {
+        if ( parentRepositories == null )
+        {
+            return mainRepositories;
+        }
+
+        if ( mainRepositories == null )
+        {
+            return ArchivaModelCloner.cloneLicenses( parentRepositories );
+        }
+
+        List merged = new ArrayList();
+
+        Map mainRepositoriesMap = createRepositoriesMap( mainRepositories );
+        Map parentRepositoriesMap = createRepositoriesMap( parentRepositories );
+
+        Iterator it = mainRepositoriesMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String key = (String) entry.getKey();
+            ProjectRepository mainProjectRepository = (ProjectRepository) entry.getValue();
+            ProjectRepository parentProjectRepository = (ProjectRepository) parentRepositoriesMap.get( key );
+
+            if ( parentProjectRepository == null )
+            {
+                merged.add( mainProjectRepository );
+            }
+            else
+            {
+                // Not merging. Local wins.
+                merged.add( parentProjectRepository );
+            }
+        }
+
+        return merged;
+    }
+
+    private static String toVersionlessArtifactKey( ArtifactReference artifactReference )
+    {
+        StringBuffer key = new StringBuffer();
+
+        key.append( artifactReference.getGroupId() ).append( ":" ).append( artifactReference.getArtifactId() );
+        key.append( StringUtils.defaultString( artifactReference.getClassifier() ) ).append( ":" );
+        key.append( artifactReference.getType() );
+
+        return key.toString();
+    }
+
+    private static String toVersionlessDependencyKey( Dependency dep )
+    {
+        StringBuffer key = new StringBuffer();
+
+        key.append( dep.getGroupId() ).append( ":" ).append( dep.getArtifactId() );
+        key.append( StringUtils.defaultString( dep.getClassifier() ) ).append( ":" );
+        key.append( dep.getType() );
+
+        return key.toString();
+    }
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java
new file mode 100644 (file)
index 0000000..316f144
--- /dev/null
@@ -0,0 +1,40 @@
+package org.apache.maven.archiva.repository.project;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+
+/**
+ * ProjectModelMonitor 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface ProjectModelMonitor
+{
+    /**
+     * Report a problem encountered with a model.
+     * 
+     * @param model the model that caused the problem.
+     * @param type the type of problem.
+     * @param problem the problem description.
+     */
+    public void modelProblem( ArchivaProjectModel model, String type, String problem );
+}
\ No newline at end of file
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java
new file mode 100644 (file)
index 0000000..de2fc43
--- /dev/null
@@ -0,0 +1,42 @@
+package org.apache.maven.archiva.repository.project;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.VersionedReference;
+
+/**
+ * Interface for ProjectModel resolution. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface ProjectModelResolver
+{
+    /**
+     * Get the ProjectModel given a specific {@link RepositoryContent} key.
+     * 
+     * @param reference the reference to the other project. 
+     * @return the ArchivaProjectModel representing the provided {@link RepositoryContent} key.
+     * @throws ProjectModelException if the project model cannot be resolved.
+     */
+    public ArchivaProjectModel resolveProjectModel( VersionedReference reference )
+        throws ProjectModelException;
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilder.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilder.java
new file mode 100644 (file)
index 0000000..549c049
--- /dev/null
@@ -0,0 +1,269 @@
+package org.apache.maven.archiva.repository.project.filters;
+
+/*
+ * 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 org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.model.ArchivaModelCloner;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.apache.maven.archiva.repository.project.ProjectModelMerge;
+import org.apache.maven.archiva.repository.project.ProjectModelResolver;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Builder for the Effective Project Model.  
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class EffectiveProjectModelBuilder
+{
+    private List projectModelResolvers;
+
+    public EffectiveProjectModelBuilder()
+    {
+        projectModelResolvers = new ArrayList();
+    }
+
+    public void addProjectModelResolver( ProjectModelResolver resolver )
+    {
+        if ( resolver == null )
+        {
+            return;
+        }
+
+        this.projectModelResolvers.add( resolver );
+    }
+
+    /**
+     * Take the provided {@link ArchivaProjectModel} and build the effective {@link ArchivaProjectModel}.
+     * 
+     * Steps:
+     * 1) Expand any expressions / properties.
+     * 2) Walk the parent project references and merge.
+     * 3) Apply dependency management settings.
+     * 
+     * @param project the project to create the effective {@link ArchivaProjectModel} from.
+     * @return a the effective {@link ArchivaProjectModel}.
+     * @throws ProjectModelException if there was a problem building the effective pom.
+     */
+    public ArchivaProjectModel buildEffectiveProjectModel( ArchivaProjectModel project )
+        throws ProjectModelException
+    {
+        if ( project == null )
+        {
+            return null;
+        }
+
+        if ( this.projectModelResolvers.isEmpty() )
+        {
+            throw new IllegalStateException( "Unable to build effective pom with no project model resolvers defined." );
+        }
+
+        // Clone submitted project (so that we don't mess with it) 
+        ArchivaProjectModel effectiveProject = ArchivaModelCloner.clone( project );
+
+        // Setup Expression Evaluation pieces.
+        ProjectModelExpressionExpander.evaluateExpressions( effectiveProject );
+
+        debug( "Starting build of effective with: " + effectiveProject );
+
+        // Merge in all the parent poms.
+        effectiveProject = mergeParent( effectiveProject );
+
+        // Resolve dependency versions from dependency management.
+        applyDependencyManagement( effectiveProject );
+
+        // Return what we got.
+        return effectiveProject;
+    }
+
+    public void removeResolver( ProjectModelResolver resolver )
+    {
+        this.projectModelResolvers.remove( resolver );
+    }
+
+    private void applyDependencyManagement( ArchivaProjectModel pom )
+    {
+        if ( ( pom.getDependencyManagement() == null ) || ( pom.getDependencies() == null ) )
+        {
+            // Nothing to do. All done!
+            return;
+        }
+        
+        if ( pom.getDependencyManagement().isEmpty() || pom.getDependencies().isEmpty() )
+        {
+            // Nothing to do. All done!
+            return;
+        }
+
+        Map managedDependencies = createDependencyMap( pom.getDependencyManagement() );
+        Iterator it = pom.getDependencies().iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dep = (Dependency) it.next();
+            String key = toVersionlessDependencyKey( dep );
+
+            // Do we need to do anything?
+            if ( managedDependencies.containsKey( key ) )
+            {
+                Dependency mgmtDep = (Dependency) managedDependencies.get( key );
+
+                dep.setVersion( mgmtDep.getVersion() );
+                dep.setScope( mgmtDep.getScope() );
+                dep.setExclusions( ProjectModelMerge.mergeExclusions( dep.getExclusions(), mgmtDep.getExclusions() ) );
+            }
+        }
+    }
+
+    private void debug( String msg )
+    {
+        System.out.println( "## " + msg );
+    }
+
+    private ArchivaProjectModel findProject( VersionedReference projectRef )
+    {
+        debug( "Trying to find project: " + projectRef );
+        Iterator it = this.projectModelResolvers.iterator();
+
+        while ( it.hasNext() )
+        {
+            ProjectModelResolver resolver = (ProjectModelResolver) it.next();
+
+            try
+            {
+                debug( "Trying to find in " + resolver.getClass().getName() );
+                ArchivaProjectModel model = resolver.resolveProjectModel( projectRef );
+
+                if ( model != null )
+                {
+                    debug( "Found it!: " + model );
+                    return model;
+                }
+                debug( "Not found." );
+            }
+            catch ( ProjectModelException e )
+            {
+                // TODO: trigger notifier of problem?
+                e.printStackTrace();
+            }
+        }
+
+        // TODO: Document that project was not found. (Use monitor?)
+
+        return null;
+    }
+
+    private ArchivaProjectModel mergeParent( ArchivaProjectModel pom )
+        throws ProjectModelException
+    {
+        ArchivaProjectModel mixedProject;
+
+        debug( "Parent: " + pom.getParentProject() );
+
+        if ( pom.getParentProject() != null )
+        {
+            // Use parent reference.
+            VersionedReference parentRef = pom.getParentProject();
+
+            debug( "Has parent: " + parentRef );
+
+            // Find parent using resolvers.
+            ArchivaProjectModel parentProject = findProject( parentRef );
+
+            if ( parentProject != null )
+            {
+                ProjectModelExpressionExpander.evaluateExpressions( parentProject );
+                parentProject = mergeParent( parentProject );
+                mixedProject = ProjectModelMerge.merge( pom, parentProject );
+            }
+            else
+            {
+                // Shortcircuit due to missing parent pom.
+                // TODO: Document this via monitor.
+                mixedProject = mixinSuperPom( pom );
+            }
+        }
+        else
+        {
+            debug( "No parent found" );
+
+            /* Mix in the super-pom.
+             * 
+             * Super POM from maven/components contains many things.
+             * However, for purposes of archiva, only the <repositories>
+             * and <pluginRepositories> sections are of any value.
+             */
+
+            mixedProject = mixinSuperPom( pom );
+        }
+
+        return mixedProject;
+    }
+
+    /**
+     * Super POM from maven/components contains many things.
+     * However, for purposes of archiva, only the <repositories>
+     * and <pluginRepositories> sections are of any value.
+     * 
+     * @param pom
+     * @return
+     */
+    private ArchivaProjectModel mixinSuperPom( ArchivaProjectModel pom )
+    {
+        // TODO: add super pom repositories.
+        debug( "Mix in Super POM: " + pom );
+
+        return pom;
+    }
+
+    private static Map createDependencyMap( List dependencies )
+    {
+        Map ret = new HashMap();
+
+        Iterator it = dependencies.iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dep = (Dependency) it.next();
+            String key = toVersionlessDependencyKey( dep );
+            ret.put( key, dep );
+        }
+
+        return ret;
+    }
+
+    private static String toVersionlessDependencyKey( Dependency dep )
+    {
+        StringBuffer key = new StringBuffer();
+
+        key.append( dep.getGroupId() ).append( ":" ).append( dep.getArtifactId() );
+        key.append( StringUtils.defaultString( dep.getClassifier() ) ).append( ":" );
+        key.append( dep.getType() );
+
+        return key.toString();
+    }
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpander.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpander.java
new file mode 100644 (file)
index 0000000..764c730
--- /dev/null
@@ -0,0 +1,92 @@
+package org.apache.maven.archiva.repository.project.filters;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator;
+import org.codehaus.plexus.evaluator.EvaluatorException;
+import org.codehaus.plexus.evaluator.ExpressionEvaluator;
+import org.codehaus.plexus.evaluator.sources.PropertiesExpressionSource;
+import org.codehaus.plexus.evaluator.sources.SystemPropertyExpressionSource;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * ProjectModelExpressionExpander 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.archiva.repository.project.ProjectModelExpressionExpander"
+ */
+public class ProjectModelExpressionExpander
+{
+    /**
+     * Find and Evaluate the Expressions present in the model.
+     * 
+     * @param model the model to correct.
+     */
+    public static void evaluateExpressions( ArchivaProjectModel model )
+        throws ProjectModelException
+    {
+        ExpressionEvaluator evaluator = new DefaultExpressionEvaluator();
+
+        if ( model.getProperties() != null )
+        {
+            PropertiesExpressionSource propsSource = new PropertiesExpressionSource();
+            propsSource.setProperties( model.getProperties() );
+            evaluator.addExpressionSource( propsSource );
+        }
+
+        evaluator.addExpressionSource( new SystemPropertyExpressionSource() );
+
+        try
+        {
+            model.setVersion( evaluator.expand( model.getVersion() ) );
+            model.setGroupId( evaluator.expand( model.getGroupId() ) );
+
+            evaluateExpressionsInDependencyList( evaluator, model.getDependencies() );
+            evaluateExpressionsInDependencyList( evaluator, model.getDependencyManagement() );
+        }
+        catch ( EvaluatorException e )
+        {
+            throw new ProjectModelException( "Unable to evaluate expression in model: " + e.getMessage(), e );
+        }
+    }
+
+    private static void evaluateExpressionsInDependencyList( ExpressionEvaluator evaluator, List dependencies )
+        throws EvaluatorException
+    {
+        if ( dependencies == null )
+        {
+            return;
+        }
+
+        Iterator it = dependencies.iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dependency = (Dependency) it.next();
+            dependency.setGroupId( evaluator.expand( dependency.getGroupId() ) );
+            dependency.setVersion( evaluator.expand( dependency.getVersion() ) );
+        }
+    }
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java
new file mode 100644 (file)
index 0000000..b3ad6bb
--- /dev/null
@@ -0,0 +1,44 @@
+package org.apache.maven.archiva.repository.project.readers;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.apache.maven.archiva.repository.project.ProjectModelReader;
+
+import java.io.File;
+
+/**
+ * ProjectModel300Reader 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProjectModel300Reader implements ProjectModelReader
+{
+
+    public ArchivaProjectModel read( File pomFile )
+    throws ProjectModelException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
new file mode 100644 (file)
index 0000000..77c28c8
--- /dev/null
@@ -0,0 +1,502 @@
+package org.apache.maven.archiva.repository.project.readers;
+
+/*
+ * 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 org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.model.CiManagement;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.DependencyScope;
+import org.apache.maven.archiva.model.Exclusion;
+import org.apache.maven.archiva.model.Individual;
+import org.apache.maven.archiva.model.IssueManagement;
+import org.apache.maven.archiva.model.License;
+import org.apache.maven.archiva.model.Organization;
+import org.apache.maven.archiva.model.ProjectRepository;
+import org.apache.maven.archiva.model.Scm;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.apache.maven.archiva.repository.project.ProjectModelReader;
+import org.apache.maven.archiva.xml.XMLException;
+import org.apache.maven.archiva.xml.XMLReader;
+import org.dom4j.Element;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * ProjectModel400Reader - read in modelVersion 4.0.0 pom files into archiva-model structures.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProjectModel400Reader
+    implements ProjectModelReader
+{
+
+    public ArchivaProjectModel read( File pomFile )
+        throws ProjectModelException
+    {
+        try
+        {
+            XMLReader xml = new XMLReader( "project", pomFile );
+
+            ArchivaProjectModel model = new ArchivaProjectModel();
+
+            if ( !"http://maven.apache.org/POM/4.0.0".equals( xml.getDefaultNamespaceURI() ) )
+            {
+                // TODO: Output to monitor the problem with the Namespace.
+                System.out.println( "No namespace defined: " + pomFile );
+            }
+
+            xml.removeNamespaces();
+
+            Element project = xml.getElement( "//project" );
+
+            model.setGroupId( project.elementTextTrim( "groupId" ) );
+            model.setArtifactId( project.elementTextTrim( "artifactId" ) );
+            model.setVersion( project.elementTextTrim( "version" ) );
+            model.setName( project.elementTextTrim( "name" ) );
+            model.setDescription( project.elementTextTrim( "description" ) );
+            model.setUrl( project.elementTextTrim( "url" ) );
+
+            model.setPackaging( StringUtils.defaultIfEmpty( project.elementTextTrim( "packaging" ), "jar" ) );
+
+            model.setParentProject( getParentProject( xml ) );
+
+            model.setCiManagement( getCiManagement( xml ) );
+            model.setIndividuals( getIndividuals( xml ) );
+            model.setIssueManagement( getIssueManagement( xml ) );
+            model.setLicenses( getLicenses( xml ) );
+            model.setOrganization( getOrganization( xml ) );
+            model.setScm( getSCM( xml ) );
+            model.setRepositories( getRepositories( xml ) );
+
+            model.setDependencies( getDependencies( xml ) );
+            model.setDependencyManagement( getDependencyManagement( xml ) );
+            model.setPlugins( getPlugins( xml ) );
+            model.setReports( getReports( xml ) );
+            model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) );
+
+            return model;
+        }
+        catch ( XMLException e )
+        {
+            throw new ProjectModelException( e.getMessage(), e );
+        }
+    }
+
+    private ArtifactReference getArtifactReference( Element elemPlugin )
+    {
+        ArtifactReference reference = new ArtifactReference();
+
+        reference.setGroupId( elemPlugin.elementTextTrim( "groupId" ) );
+        reference.setArtifactId( elemPlugin.elementTextTrim( "artifactId" ) );
+        reference.setVersion( elemPlugin.elementTextTrim( "version" ) );
+        reference.setClassifier( elemPlugin.elementTextTrim( "classifier" ) );
+        reference.setType( elemPlugin.elementTextTrim( "type" ) );
+
+        return reference;
+    }
+
+    private CiManagement getCiManagement( XMLReader xml )
+        throws XMLException
+    {
+        Element elemCiMgmt = xml.getElement( "//project/ciManagement" );
+        if ( elemCiMgmt != null )
+        {
+            CiManagement ciManagement = new CiManagement();
+            ciManagement.setSystem( elemCiMgmt.elementTextTrim( "system" ) );
+            ciManagement.setUrl( elemCiMgmt.elementTextTrim( "url" ) );
+            return ciManagement;
+        }
+
+        return null;
+    }
+
+    private List getDependencies( XMLReader xml )
+        throws XMLException
+    {
+        return getDependencyList( xml, new String[] { "dependencies" } );
+    }
+
+    private List getDependencyList( XMLReader xml, String parts[] )
+        throws XMLException
+    {
+        List dependencyList = new ArrayList();
+
+        Element project = xml.getElement( "//project" );
+
+        Element depsParent = project;
+
+        for ( int i = 0; i < parts.length; i++ )
+        {
+            String part = parts[i];
+            depsParent = depsParent.element( part );
+            if ( depsParent == null )
+            {
+                return dependencyList;
+            }
+        }
+
+        Iterator it = depsParent.elementIterator( "dependency" );
+        while ( it.hasNext() )
+        {
+            Element elemDependency = (Element) it.next();
+            Dependency dependency = new Dependency();
+
+            dependency.setGroupId( elemDependency.elementTextTrim( "groupId" ) );
+            dependency.setArtifactId( elemDependency.elementTextTrim( "artifactId" ) );
+            dependency.setVersion( elemDependency.elementTextTrim( "version" ) );
+
+            dependency.setClassifier( elemDependency.elementTextTrim( "classifier" ) );
+            dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) );
+            dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) );
+            // Not for v4.0.0 -> dependency.setUrl( elemDependency.elementTextTrim("url") );
+            dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) );
+            if ( DependencyScope.isSystemScoped( dependency ) )
+            {
+                dependency.setSystemPath( elemDependency.elementTextTrim( "systemPath" ) );
+            }
+
+            dependency.setExclusions( getExclusions( elemDependency ) );
+
+            if ( dependencyList.contains( dependency ) )
+            {
+                // TODO: throw into monitor as issue.
+                System.err.println( "Duplicate non-unique dependency detected [" + StringUtils.join(parts, ":") + "]: "
+                    + toDependencyKey( dependency ) );
+            }
+
+            dependencyList.add( dependency );
+            System.out.println( "Added (list.size:" + dependencyList.size() + ") dependency: "
+                + toDependencyKey( dependency ) );
+        }
+
+        System.out.println( "## Returning dependency list: size=" + dependencyList.size() );
+        return dependencyList;
+    }
+
+    private List getDependencyManagement( XMLReader xml )
+        throws XMLException
+    {
+        return getDependencyList( xml, new String[] { "dependencyManagement", "dependencies" } );
+    }
+
+    private List getExclusions( Element elemDependency )
+    {
+        List exclusions = new ArrayList();
+
+        Element elemExclusions = elemDependency.element( "exclusions" );
+
+        if ( elemExclusions != null )
+        {
+            Iterator it = elemExclusions.elementIterator( "exclusion" );
+            while ( it.hasNext() )
+            {
+                Element elemExclusion = (Element) it.next();
+                Exclusion exclusion = new Exclusion();
+
+                exclusion.setGroupId( elemExclusion.elementTextTrim( "groupId" ) );
+                exclusion.setArtifactId( elemExclusion.elementTextTrim( "artifactId" ) );
+
+                exclusions.add( exclusion );
+            }
+        }
+
+        return exclusions;
+    }
+
+    private List getIndividuals( XMLReader xml )
+        throws XMLException
+    {
+        List individuals = new ArrayList();
+
+        individuals.addAll( getIndividuals( xml, true, "//project/developers/developer" ) );
+        individuals.addAll( getIndividuals( xml, false, "//project/contributors/contributor" ) );
+
+        return individuals;
+    }
+
+    private List getIndividuals( XMLReader xml, boolean isCommitor, String xpathExpr )
+        throws XMLException
+    {
+        List ret = new ArrayList();
+
+        List modelPersonList = xml.getElementList( xpathExpr );
+
+        Iterator iter = modelPersonList.iterator();
+        while ( iter.hasNext() )
+        {
+            Element elemPerson = (Element) iter.next();
+            Individual individual = new Individual();
+
+            individual.setCommitor( isCommitor );
+            individual.setEmail( elemPerson.elementTextTrim( "email" ) );
+            individual.setName( elemPerson.elementTextTrim( "name" ) );
+            individual.setOrganization( elemPerson.elementTextTrim( "organization" ) );
+            individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) );
+            individual.setUrl( elemPerson.elementTextTrim( "url" ) );
+            individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) );
+
+            // Roles
+            Element elemRoles = elemPerson.element( "roles" );
+            if ( elemRoles != null )
+            {
+                List roleNames = elemRoles.elements( "role" );
+                Iterator itRole = roleNames.iterator();
+                while ( itRole.hasNext() )
+                {
+                    Element role = (Element) itRole.next();
+                    individual.addRole( role.getTextTrim() );
+                }
+            }
+
+            // Properties
+            individual.setProperties( getProperties( elemPerson.element( "properties" ) ) );
+
+            ret.add( individual );
+        }
+
+        return ret;
+    }
+
+    private IssueManagement getIssueManagement( XMLReader xml )
+        throws XMLException
+    {
+        Element elemIssueMgmt = xml.getElement( "//project/issueManagement" );
+        if ( elemIssueMgmt != null )
+        {
+            IssueManagement issueMgmt = new IssueManagement();
+
+            issueMgmt.setSystem( elemIssueMgmt.elementTextTrim( "system" ) );
+            issueMgmt.setUrl( elemIssueMgmt.elementTextTrim( "url" ) );
+
+            return issueMgmt;
+        }
+
+        return null;
+    }
+
+    private List getLicenses( XMLReader xml )
+        throws XMLException
+    {
+        List licenses = new ArrayList();
+
+        Element elemLicenses = xml.getElement( "//project/licenses" );
+
+        if ( elemLicenses != null )
+        {
+            Iterator itLicense = elemLicenses.elements( "license" ).iterator();
+            while ( itLicense.hasNext() )
+            {
+                Element elemLicense = (Element) itLicense.next();
+                License license = new License();
+
+                // TODO: Create LicenseIdentity class to managed license ids.
+                // license.setId( elemLicense.elementTextTrim("id") );
+                license.setName( elemLicense.elementTextTrim( "name" ) );
+                license.setUrl( elemLicense.elementTextTrim( "url" ) );
+                license.setComments( elemLicense.elementTextTrim( "comments" ) );
+
+                licenses.add( license );
+            }
+        }
+
+        return licenses;
+    }
+
+    private Organization getOrganization( XMLReader xml )
+        throws XMLException
+    {
+        Element elemOrg = xml.getElement( "//project/organization" );
+        if ( elemOrg != null )
+        {
+            Organization org = new Organization();
+
+            org.setName( elemOrg.elementTextTrim( "name" ) );
+            org.setUrl( elemOrg.elementTextTrim( "url" ) );
+
+            return org;
+        }
+
+        return null;
+    }
+
+    private VersionedReference getParentProject( XMLReader xml )
+        throws XMLException
+    {
+        Element elemParent = xml.getElement( "//project/parent" );
+
+        if ( elemParent != null )
+        {
+            return getVersionedReference( elemParent );
+        }
+
+        return null;
+    }
+
+    private List getPlugins( XMLReader xml )
+        throws XMLException
+    {
+        return getPlugins( xml, "//project/build/plugins/plugin" );
+    }
+
+    /**
+     * Get List of {@link RepositoryContent} objects from plugin definitions.
+     */
+    private List getPlugins( XMLReader xml, String xpathExpr )
+        throws XMLException
+    {
+        List plugins = new ArrayList();
+
+        Iterator it = xml.getElementList( xpathExpr ).iterator();
+        while ( it.hasNext() )
+        {
+            Element elemPlugin = (Element) it.next();
+
+            plugins.add( getArtifactReference( elemPlugin ) );
+        }
+
+        return plugins;
+    }
+
+    private Properties getProperties( Element elemProperties )
+    {
+        if ( elemProperties == null )
+        {
+            return null;
+        }
+
+        Properties ret = new Properties();
+
+        Iterator itProps = elemProperties.elements().iterator();
+        while ( itProps.hasNext() )
+        {
+            Element elemProp = (Element) itProps.next();
+            ret.setProperty( elemProp.getName(), elemProp.getText() );
+        }
+
+        return ret;
+    }
+
+    private List getReports( XMLReader xml )
+        throws XMLException
+    {
+        return getPlugins( xml, "//project/reporting/plugins/plugin" );
+    }
+
+    private List getRepositories( XMLReader xml )
+        throws XMLException
+    {
+        List repos = new ArrayList();
+
+        repos.addAll( getRepositories( xml, false, "//project/repositories/repository" ) );
+        repos.addAll( getRepositories( xml, true, "//project/pluginRepositories/pluginRepository" ) );
+
+        return repos;
+    }
+
+    private List getRepositories( XMLReader xml, boolean isPluginRepo, String xpathExpr )
+        throws XMLException
+    {
+        List ret = new ArrayList();
+
+        List repositoriesList = xml.getElementList( xpathExpr );
+
+        Iterator itRepos = repositoriesList.iterator();
+        while ( itRepos.hasNext() )
+        {
+            Element elemRepo = (Element) itRepos.next();
+            ProjectRepository repo = new ProjectRepository();
+
+            repo.setId( elemRepo.elementTextTrim( "id" ) );
+            repo.setName( elemRepo.elementTextTrim( "name" ) );
+            repo.setUrl( elemRepo.elementTextTrim( "url" ) );
+            repo.setLayout( StringUtils.defaultIfEmpty( elemRepo.elementTextTrim( "layout" ), "default" ) );
+            repo.setPlugins( isPluginRepo );
+
+            repo.setReleases( toBoolean( xml.getElementText( elemRepo, "releases/enabled" ), true ) );
+            repo.setSnapshots( toBoolean( xml.getElementText( elemRepo, "snapshots/enabled" ), false ) );
+
+            ret.add( repo );
+        }
+
+        return ret;
+    }
+
+    private Scm getSCM( XMLReader xml )
+        throws XMLException
+    {
+        Element elemScm = xml.getElement( "//project/scm" );
+
+        if ( elemScm != null )
+        {
+            Scm scm = new Scm();
+
+            scm.setConnection( elemScm.elementTextTrim( "connection" ) );
+            scm.setDeveloperConnection( elemScm.elementTextTrim( "developerConnection" ) );
+            scm.setUrl( elemScm.elementTextTrim( "url" ) );
+
+            return scm;
+        }
+
+        return null;
+    }
+
+    private VersionedReference getVersionedReference( Element elem )
+    {
+        VersionedReference reference = new VersionedReference();
+
+        reference.setGroupId( elem.elementTextTrim( "groupId" ) );
+        reference.setArtifactId( elem.elementTextTrim( "artifactId" ) );
+        reference.setVersion( elem.elementTextTrim( "version" ) );
+
+        return reference;
+    }
+
+    private boolean toBoolean( String value, boolean defaultValue )
+    {
+        if ( StringUtils.equalsIgnoreCase( value, "true" ) )
+        {
+            return true;
+        }
+        else if ( StringUtils.equalsIgnoreCase( value, "false" ) )
+        {
+            return false;
+        }
+        else
+        {
+            // If unset, or not "true" or "false".
+            return defaultValue;
+        }
+    }
+
+    private String toDependencyKey( Dependency dep )
+    {
+        return "[" + dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion() + ":" + dep.getClassifier()
+            + ":" + dep.getType() + "]";
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/RepositoryProjectResolver.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/RepositoryProjectResolver.java
new file mode 100644 (file)
index 0000000..d33d741
--- /dev/null
@@ -0,0 +1,69 @@
+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 org.apache.maven.archiva.model.ArchivaArtifact;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
+import org.apache.maven.archiva.repository.layout.DefaultBidirectionalRepositoryLayout;
+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.repository.project.readers.ProjectModel400Reader;
+
+import java.io.File;
+
+/**
+ * RepositoryProjectResolver 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RepositoryProjectResolver
+    implements ProjectModelResolver
+{
+    private ArchivaRepository repository;
+
+    private ProjectModelReader reader;
+
+    private BidirectionalRepositoryLayout layout;
+
+    public RepositoryProjectResolver( ArchivaRepository repository )
+    {
+        this.repository = repository;
+        this.reader = new ProjectModel400Reader();
+        this.layout = new DefaultBidirectionalRepositoryLayout();
+    }
+
+    public ArchivaProjectModel resolveProjectModel( VersionedReference reference )
+        throws ProjectModelException
+    {
+        ArchivaArtifact artifact = new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference
+            .getVersion(), "", "pom" );
+
+        String path = layout.pathOf( artifact );
+        File repoFile = new File( this.repository.getUrl().getPath(), path );
+
+        return reader.read( repoFile );
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/effective-poms/archiva-model-effective.pom b/archiva-base/archiva-repository-layer/src/test/effective-poms/archiva-model-effective.pom
new file mode 100644 (file)
index 0000000..9129a9d
--- /dev/null
@@ -0,0 +1,794 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <parent>
+    <artifactId>archiva-base</artifactId>
+    <groupId>org.apache.maven.archiva</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.archiva</groupId>
+  <artifactId>archiva-model</artifactId>
+  <name>Archiva Base :: Model</name>
+  <version>1.0-SNAPSHOT</version>
+  <description>Archiva is an application for managing one or more remote repositories, including
+    administration, artifact handling,
+    browsing and searching.</description>
+  <url>http://maven.apache.org/archiva/archiva-base/archiva-model</url>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/MRM</url>
+  </issueManagement>
+  <ciManagement>
+    <system>continuum</system>
+    <url>http://maven.zones.apache.org:8080/continuum</url>
+    <notifiers>
+      <notifier>
+        <configuration>
+          <address>notifications@maven.apache.org</address>
+        </configuration>
+      </notifier>
+    </notifiers>
+  </ciManagement>
+  <inceptionYear>2002</inceptionYear>
+  <mailingLists>
+    <mailingList>
+      <name>Maven Archiva User List</name>
+      <subscribe>archiva-users-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-users-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-users@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-users</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Developer List</name>
+      <subscribe>archiva-dev-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-dev-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-dev@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-dev</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Commits List</name>
+      <subscribe>archiva-commits-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-commits-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-commits@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-commits</archive>
+    </mailingList>
+  </mailingLists>
+  <developers>
+    <developer>
+      <id>jvanzyl</id>
+      <name>Jason van Zyl</name>
+      <email>jason@maven.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Chair</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>brett</id>
+      <name>Brett Porter</name>
+      <email>brett@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+10</timezone>
+    </developer>
+    <developer>
+      <id>evenisse</id>
+      <name>Emmanuel Venisse</name>
+      <email>evenisse@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>kenney</id>
+      <name>Kenney Westerhof</name>
+      <email>kenney@apache.org</email>
+      <organization>Neonics</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+    </developer>
+    <developer>
+      <id>snicoll</id>
+      <name>Stephane Nicoll</name>
+      <email>snicoll@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>vmassol</id>
+      <name>Vincent Massol</name>
+      <email>vmassol@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>fgiust</id>
+      <name>Fabrizio Giustina</name>
+      <email>fgiust@apache.org</email>
+      <organization>openmind</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>epunzalan</id>
+      <name>Edwin Punzalan</name>
+      <email>epunzalan@mergere.com</email>
+      <organization>Mergere</organization>
+      <roles>
+        <role>Committer</role>
+      </roles>
+      <timezone>+8</timezone>
+    </developer>
+    <developer>
+      <id>mperham</id>
+      <name>Mike Perham</name>
+      <email>mperham@gmail.com</email>
+      <organization>IBM</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-6</timezone>
+    </developer>
+    <developer>
+      <id>jdcasey</id>
+      <name>John Casey</name>
+      <email>jdcasey@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>trygvis</id>
+      <name>Trygve Laugstol</name>
+      <email>trygvis@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>vsiveton</id>
+      <name>Vincent Siveton</name>
+      <email>vsiveton@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>carlos</id>
+      <name>Carlos Sanchez</name>
+      <email>carlos@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>dennisl</id>
+      <name>Dennis Lundberg</name>
+      <email>dennisl@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+  </developers>
+  <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>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk/archiva-base/archiva-model</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk/archiva-base/archiva-model</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk/archiva-base/archiva-model</url>
+  </scm>
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <build>
+    <sourceDirectory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/main/java</sourceDirectory>
+    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+    <testSourceDirectory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/java</testSourceDirectory>
+    <outputDirectory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/classes</outputDirectory>
+    <testOutputDirectory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/test-classes</testOutputDirectory>
+    <resources>
+      <resource>
+        <directory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/main/resources</directory>
+      </resource>
+    </resources>
+    <testResources>
+      <testResource>
+        <directory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/resources</directory>
+      </testResource>
+    </testResources>
+    <directory>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target</directory>
+    <finalName>archiva-model-1.0-SNAPSHOT</finalName>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-idea-plugin</artifactId>
+          <configuration>
+            <jdkLevel>1.4</jdkLevel>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-release-plugin</artifactId>
+          <configuration>
+            <tagBase>https://svn.apache.org/repos/asf/maven/archiva/tags</tagBase>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <version>1.3.3</version>
+        <executions>
+          <execution>
+            <id>generate</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <target>1.4</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-15-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>archiva-base</id>
+            <goals>
+              <goal>java</goal>
+              <goal>xsd</goal>
+              <goal>jpox-jdo-mapping</goal>
+              <goal>jpox-metadata-class</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <packageWithVersion>false</packageWithVersion>
+          <model>src/main/mdo/archiva-base.xml</model>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>jpox-maven-plugin</artifactId>
+        <version>1.1.6</version>
+        <executions>
+          <execution>
+            <id>create-ddl</id>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>schema-create</goal>
+            </goals>
+            <configuration>
+              <outputFile>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/classes/org/apache/maven/archiva/model/schema.ddl</outputFile>
+              <toolProperties>
+                <property>
+                  <name>javax.jdo.option.ConnectionDriverName</name>
+                  <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionURL</name>
+                  <value>jdbc:derby:target/jdo-schema-create;create=true</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionUserName</name>
+                  <value>sa</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionPassword</name>
+                  <value></value>
+                </property>
+                <property>
+                  <name>log4j.configuration</name>
+                  <value>/home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/resources/log4j.xml</value>
+                </property>
+                <property>
+                  <name>org.jpox.autoCreateTables</name>
+                  <value>true</value>
+                </property>
+              </toolProperties>
+            </configuration>
+          </execution>
+          <execution>
+            <id>enhance</id>
+            <goals>
+              <goal>enhance</goal>
+            </goals>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.2.1.6</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <excludes>
+              <exclude>org/apache/maven/archiva/reporting/model/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-help-plugin</artifactId>
+        <version>2.0.1</version>
+      </plugin>
+    </plugins>
+  </build>
+  <repositories>
+    <repository>
+      <releases />
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>codehaus.org</id>
+      <url>http://repository.codehaus.org</url>
+    </repository>
+    <repository>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots />
+      <id>snapshots.codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+    </repository>
+    <repository>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+    </repository>
+    <repository>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>central</id>
+      <name>Maven Repository Switchboard</name>
+      <url>http://repo1.maven.org/maven2</url>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots />
+      <id>snapshots.codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+    </pluginRepository>
+    <pluginRepository>
+      <releases>
+        <updatePolicy>never</updatePolicy>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>central</id>
+      <name>Maven Plugin Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+    </pluginRepository>
+  </pluginRepositories>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.jdo</groupId>
+      <artifactId>jdo2-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-18</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.2</version>
+    </dependency>
+  </dependencies>
+  <reporting>
+    <outputDirectory>target/site</outputDirectory>
+    <plugins>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>config/maven_checks.xml</configLocation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-jxr-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>changelog-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+      </plugin>
+    </plugins>
+  </reporting>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-web</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-container-default</artifactId>
+        <version>1.0-alpha-18</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-api</artifactId>
+        <version>1.0-alpha-18</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-utils</artifactId>
+        <version>1.4</version>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-log4j12</artifactId>
+        <version>1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-repository-metadata</artifactId>
+        <version>2.0.5</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-model</artifactId>
+        <version>2.0.5</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact</artifactId>
+        <version>2.0.5</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact-manager</artifactId>
+        <version>2.0.5</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-project</artifactId>
+        <version>2.0.5</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-model-converter</artifactId>
+        <version>2.0.5-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-provider-api</artifactId>
+        <version>1.0-beta-2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-ssh</artifactId>
+        <version>1.0-beta-2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-file</artifactId>
+        <version>1.0-beta-2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-http-lightweight</artifactId>
+        <version>1.0-beta-2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-core</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-reports-standard</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-database</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-consumer-api</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-database</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-discoverer</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-repository-layer</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-indexer</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-proxy</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-applet</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-security</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-configuration</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-converter</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-utils</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-webapp</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-digest</artifactId>
+        <version>1.1-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-rbac-profile</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-integration</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-taglib</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-user-manager</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-keystore</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-api</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-provider-jdo</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-cached</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-jdo</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-api</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-keys-jdo</artifactId>
+        <version>1.0-alpha-11-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.2</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.derby</groupId>
+        <artifactId>derby</artifactId>
+        <version>10.1.3.1</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <distributionManagement>
+    <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>
+    <site>
+      <id>apache.website</id>
+      <url>scpexe://people.apache.org/www/maven.apache.org/archiva/archiva-base/archiva-model</url>
+    </site>
+  </distributionManagement>
+  <properties>
+    <plexus-security.version>1.0-alpha-11-SNAPSHOT</plexus-security.version>
+    <wagon.version>1.0-beta-2</wagon.version>
+    <maven.version>2.0.5</maven.version>
+    <archiva.version>1.0-SNAPSHOT</archiva.version>
+  </properties>
+</project>
index 5b6af02a869cb879536ec54f86438dbeee927159..676872b2da8df67f61932f6f052951aaf421e806 100644 (file)
@@ -42,8 +42,8 @@ public class RepositoryMetadataReaderTest extends PlexusTestCase
         ArchivaRepositoryMetadata metadata = reader.read( metadataFile );
 
         assertNotNull( metadata );
-        assertEquals( "Group Id", "org.apache.maven.shared", metadata.getContentKey().getGroupId() );
-        assertEquals( "Artifact Id", "maven-downloader", metadata.getContentKey().getArtifactId() );
+        assertEquals( "Group Id", "org.apache.maven.shared", metadata.getGroupId() );
+        assertEquals( "Artifact Id", "maven-downloader", metadata.getArtifactId() );
         assertEquals( "Released Version", "1.1", metadata.getReleasedVersion() );
         assertEquals( "List of Available Versions", 2, metadata.getAvailableVersions().size() );
         assertTrue( "Available version 1.0", metadata.getAvailableVersions().contains( "1.0" ) );
index a9646e9359448d0a4bf359542c529107699eb008..7ff3c1ccf5eecfdf125df211b90266c62a31deba 100644 (file)
@@ -35,7 +35,8 @@ public class AllTests
     {
         TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repository.project" );
         //$JUnit-BEGIN$
-        suite.addTestSuite( ProjectModel400ReaderTest.class );
+        suite.addTest( org.apache.maven.archiva.repository.project.filters.AllTests.suite() );
+        suite.addTest( org.apache.maven.archiva.repository.project.readers.AllTests.suite() );
         //$JUnit-END$
         return suite;
     }
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/ProjectModel400ReaderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/ProjectModel400ReaderTest.java
deleted file mode 100644 (file)
index a413ed2..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.apache.maven.archiva.repository.project;
-
-/*
- * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.codehaus.plexus.PlexusTestCase;
-
-import java.io.File;
-
-/**
- * ProjectModel400ReaderTest 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class ProjectModel400ReaderTest extends PlexusTestCase
-{
-    public void testLoadSimple() throws ProjectModelException
-    {
-        File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
-        File pomFile = new File( defaultRepoDir, "org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom" );
-
-        ProjectModelReader reader = new ProjectModel400Reader();
-
-        ArchivaProjectModel project = reader.read( pomFile );
-
-        assertNotNull( project );
-        assertEquals( "Group Id", "org.apache.maven.shared", project.getContentKey().getGroupId() );
-        assertEquals( "Artifact Id", "maven-downloader", project.getContentKey().getArtifactId() );
-        assertEquals( "Released Version", "1.0", project.getContentKey().getVersion() );
-        assertEquals( "Name", "Maven Downloader", project.getName() );
-        assertEquals( "Description", "Provide a super simple interface for downloading a single artifact.", project.getDescription() );
-//        assertTrue( "Available version 1.0", project.getAvailableVersions().contains( "1.0" ) );
-//        assertTrue( "Available version 1.1", project.getAvailableVersions().contains( "1.1" ) );
-    }
-}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/AllTests.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/AllTests.java
new file mode 100644 (file)
index 0000000..a4bf59f
--- /dev/null
@@ -0,0 +1,44 @@
+package org.apache.maven.archiva.repository.project.filters;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repository.project.filters" );
+        //$JUnit-BEGIN$
+        suite.addTestSuite( ProjectModelExpressionExpanderTest.class );
+        suite.addTestSuite( EffectiveProjectModelBuilderTest.class );
+        //$JUnit-END$
+        return suite;
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelBuilderTest.java
new file mode 100644 (file)
index 0000000..fd82b34
--- /dev/null
@@ -0,0 +1,143 @@
+package org.apache.maven.archiva.repository.project.filters;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.model.Dependency;
+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.repository.project.filters.EffectiveProjectModelBuilder;
+import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
+import org.apache.maven.archiva.repository.project.resolvers.RepositoryProjectResolver;
+import org.codehaus.plexus.PlexusTestCase;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * EffectiveProjectModelBuilderTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class EffectiveProjectModelBuilderTest
+    extends PlexusTestCase
+{
+    private static final String DEFAULT_REPOSITORY = "src/test/repositories/default-repository";
+
+    private ArchivaProjectModel createArchivaProjectModel( String path )
+        throws ProjectModelException
+    {
+        ProjectModelReader reader = new ProjectModel400Reader();
+
+        File pomFile = new File( getBasedir(), path );
+
+        return reader.read( pomFile );
+    }
+
+    private ProjectModelResolver createDefaultRepositoryResolver()
+    {
+        File defaultRepoDir = new File( getBasedir(), DEFAULT_REPOSITORY );
+
+        ArchivaRepository repo = new ArchivaRepository( "defaultTestRepo", "Default Test Repo", "file://"
+            + defaultRepoDir.getAbsolutePath() );
+
+        RepositoryProjectResolver resolver = new RepositoryProjectResolver( repo );
+
+        return resolver;
+    }
+
+    public void testBuildEffectiveProject()
+        throws Exception
+    {
+        EffectiveProjectModelBuilder builder = new EffectiveProjectModelBuilder();
+        builder.addProjectModelResolver( createDefaultRepositoryResolver() );
+
+        ArchivaProjectModel startModel = createArchivaProjectModel( DEFAULT_REPOSITORY
+            + "/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom" );
+
+        ArchivaProjectModel effectiveModel = builder.buildEffectiveProjectModel( startModel );
+
+        ArchivaProjectModel expectedModel = createArchivaProjectModel( "src/test/effective-poms/"
+            + "/archiva-model-effective.pom" );
+
+        assertModel( expectedModel, effectiveModel );
+    }
+
+    private void assertModel( ArchivaProjectModel expectedModel, ArchivaProjectModel effectiveModel )
+    {
+        assertEquals( "Equivalent Models", expectedModel, effectiveModel );
+
+        assertContainsSame( "Individuals", expectedModel.getIndividuals(), effectiveModel.getIndividuals() );
+        dumpDependencyList( "Expected", expectedModel.getDependencies() );
+        dumpDependencyList( "Effective", effectiveModel.getDependencies() );
+        assertContainsSame( "Dependencies", expectedModel.getDependencies(), effectiveModel.getDependencies() );
+        assertContainsSame( "DependencyManagement", expectedModel.getDependencyManagement(), effectiveModel
+            .getDependencyManagement() );
+    }
+    
+    private void dumpDependencyList( String type, List deps )
+    {
+        System.out.println( ".\\ [" + type + "] Dependency List (size:" + deps.size() + ") \\.________________" );
+        Iterator it = deps.iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dep = (Dependency) it.next();
+            System.out.println( "  " + toDependencyKey( dep ) );
+        }
+        System.out.println( "" );
+    }
+    
+    private String toDependencyKey( Dependency dep )
+    {
+        return "[" + dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion() + ":" + dep.getClassifier()
+            + ":" + dep.getType() + "]";
+    }
+
+    private void assertContainsSame( String listId, List expectedList, List effectiveList )
+    {
+        if ( ( expectedList == null ) && ( effectiveList == null ) )
+        {
+            return;
+        }
+
+        if ( ( expectedList == null ) && ( effectiveList != null ) )
+        {
+            fail( "Effective [" + listId + "] List is instantiated, while expected List is null." );
+        }
+
+        if ( ( expectedList != null ) && ( effectiveList == null ) )
+        {
+            fail( "Effective [" + listId + "] List is null, while expected List is instantiated." );
+        }
+
+        assertEquals( "[" + listId + "] List Size", expectedList.size(), expectedList.size() );
+
+        Iterator it = expectedList.iterator();
+        while ( it.hasNext() )
+        {
+            Object o = it.next();
+            assertTrue( "Should exist in Effective [" + listId + "] list: " + o, effectiveList.contains( o ) );
+        }
+    }
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java
new file mode 100644 (file)
index 0000000..ed06ac9
--- /dev/null
@@ -0,0 +1,84 @@
+package org.apache.maven.archiva.repository.project.filters;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.apache.maven.archiva.repository.project.filters.ProjectModelExpressionExpander;
+
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+/**
+ * ProjectModelExpressionExpanderTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProjectModelExpressionExpanderTest
+    extends TestCase
+{
+    public void testExpressionEvaluation()
+        throws ProjectModelException
+    {
+        ArchivaProjectModel model = new ArchivaProjectModel();
+        model.setGroupId( "org.apache.maven.archiva" );
+        model.setArtifactId( "archiva-test-project" );
+        model.setVersion( "1.0-SNAPSHOT" );
+
+        model.addDependency( createDependency( "org.apache.maven.archiva", "archiva-model", "${archiva.version}" ) );
+        model.addDependency( createDependency( "org.apache.maven.archiva", "archiva-common", "${archiva.version}" ) );
+        model.addDependency( createDependency( "org.apache.maven.archiva", "archiva-indexer", "${archiva.version}" ) );
+
+        model.addProperty( "archiva.version", "1.0-SNAPSHOT" );
+
+        ProjectModelExpressionExpander.evaluateExpressions( model );
+
+        assertNotNull( model );
+        assertEquals( "Group ID", "org.apache.maven.archiva", model.getGroupId() );
+        assertEquals( "Artifact ID", "archiva-test-project", model.getArtifactId() );
+        assertEquals( "Version", "1.0-SNAPSHOT", model.getVersion() );
+        assertNotNull( "Dependencies", model.getDependencies() );
+        assertEquals( "Dependencies Size", 3, model.getDependencies().size() );
+
+        Iterator it = model.getDependencies().iterator();
+        while ( it.hasNext() )
+        {
+            Dependency dep = (Dependency) it.next();
+            assertEquals( "Dependency [" + dep.getArtifactId() + "] Group ID", "org.apache.maven.archiva", dep
+                .getGroupId() );
+            assertEquals( "Dependency [" + dep.getArtifactId() + "] Version", "1.0-SNAPSHOT", dep.getVersion() );
+        }
+    }
+
+    private Dependency createDependency( String groupId, String artifactId, String version )
+    {
+        Dependency dep = new Dependency();
+
+        dep.setGroupId( groupId );
+        dep.setArtifactId( artifactId );
+        dep.setVersion( version );
+
+        return dep;
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/AllTests.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/AllTests.java
new file mode 100644 (file)
index 0000000..0c55a71
--- /dev/null
@@ -0,0 +1,43 @@
+package org.apache.maven.archiva.repository.project.readers;
+
+/*
+ * 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 junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * AllTests 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class AllTests
+{
+
+    public static Test suite()
+    {
+        TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repository.project.readers" );
+        //$JUnit-BEGIN$
+        suite.addTestSuite( ProjectModel400ReaderTest.class );
+        //$JUnit-END$
+        return suite;
+    }
+
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java
new file mode 100644 (file)
index 0000000..3735ea7
--- /dev/null
@@ -0,0 +1,98 @@
+package org.apache.maven.archiva.repository.project.readers;
+
+/*
+ * 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 org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.project.ProjectModelException;
+import org.apache.maven.archiva.repository.project.ProjectModelReader;
+import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
+import org.codehaus.plexus.PlexusTestCase;
+
+import java.io.File;
+
+/**
+ * ProjectModel400ReaderTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProjectModel400ReaderTest
+    extends PlexusTestCase
+{
+    public void testLoadSimple()
+        throws ProjectModelException
+    {
+        File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
+        File pomFile = new File( defaultRepoDir,
+                                 "org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom" );
+
+        ProjectModelReader reader = new ProjectModel400Reader();
+
+        ArchivaProjectModel project = reader.read( pomFile );
+
+        assertNotNull( project );
+        assertEquals( "Group Id", "org.apache.maven.shared", project.getGroupId() );
+        assertEquals( "Artifact Id", "maven-downloader", project.getArtifactId() );
+        assertEquals( "Version", "1.0", project.getVersion() );
+        assertEquals( "Name", "Maven Downloader", project.getName() );
+        assertEquals( "Description", "Provide a super simple interface for downloading a single artifact.", project
+            .getDescription() );
+
+        // Test for parent
+        VersionedReference parentRef = project.getParentProject();
+        assertNotNull( "Parent Reference", parentRef );
+        assertEquals( "Parent Group ID", "org.apache.maven.shared", parentRef.getGroupId() );
+        assertEquals( "Parent Artifact ID", "maven-shared-components", parentRef.getArtifactId() );
+        assertEquals( "Parent Version", "4", parentRef.getVersion() );
+
+        assertNotNull( "Dependencies", project.getDependencies() );
+        assertEquals( "Dependencies.size", 3, project.getDependencies().size() );
+    }
+
+    public void testLoadWithNamespace()
+        throws ProjectModelException
+    {
+        File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
+        File pomFile = new File( defaultRepoDir,
+                                 "org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom" );
+
+        ProjectModelReader reader = new ProjectModel400Reader();
+
+        ArchivaProjectModel project = reader.read( pomFile );
+
+        assertNotNull( project );
+        assertEquals( "Group Id", null, project.getGroupId() );
+        assertEquals( "Artifact Id", "archiva-model", project.getArtifactId() );
+        assertEquals( "Version", null, project.getVersion() );
+        assertEquals( "Name", "Archiva Base :: Model", project.getName() );
+        assertEquals( "Description", null, project.getDescription() );
+
+        // Test for parent
+        VersionedReference parentRef = project.getParentProject();
+        assertNotNull( "Parent Reference", parentRef );
+        assertEquals( "Parent Group ID", "org.apache.maven.archiva", parentRef.getGroupId() );
+        assertEquals( "Parent Artifact ID", "archiva-base", parentRef.getArtifactId() );
+        assertEquals( "Parent Version", "1.0-SNAPSHOT", parentRef.getVersion() );
+        
+        assertNotNull( "Dependencies", project.getDependencies() );
+        assertEquals( "Dependencies.size", 6, project.getDependencies().size() );
+    }
+}
diff --git a/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java b/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java
deleted file mode 100644 (file)
index 1472313..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-package org.apache.maven.archiva.repository.scanner;
-
-/*
- * 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 org.apache.maven.archiva.common.utils.DateUtil;
-import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
-import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.model.RepositoryContentStatistics;
-import org.apache.maven.archiva.repository.RepositoryException;
-import org.apache.maven.archiva.repository.project.ProjectModel400Reader;
-import org.apache.maven.archiva.repository.project.ProjectModelException;
-import org.apache.maven.archiva.repository.project.ProjectModelReader;
-
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * CentralScannerTiming 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class CentralScannerTiming
-{
-    public static void main( String[] args )
-    {
-        String pathToCentral = "/home/repo1/ibiblio";
-
-        ( new CentralScannerTiming() ).scanIt( pathToCentral );
-    }
-
-    public void scanIt( String path )
-    {
-        ArchivaRepository centralRepo = new ArchivaRepository( "central", "Central Mirror", "file://" + path );
-
-        List consumerList = new ArrayList();
-
-        // Basic - find the artifacts (no real processing)
-
-        consumerList.add( new BasicConsumer() );
-        timeIt( "Basic Scan", centralRepo, consumerList );
-
-        // POM - find the poms and read them.
-
-        consumerList.clear();
-        consumerList.add( new POMConsumer() );
-        timeIt( "POM Read", centralRepo, consumerList );
-    }
-
-    private void timeIt( String type, ArchivaRepository repo, List consumerList )
-    {
-        RepositoryScanner scanner = new RepositoryScanner();
-
-        try
-        {
-            RepositoryContentStatistics stats = scanner.scan( repo, consumerList, true );
-
-            SimpleDateFormat df = new SimpleDateFormat();
-            System.out.println( ".\\ " + type + " \\.__________________________________________" );
-            System.out.println( "  Repository ID   : " + stats.getRepositoryId() );
-            System.out.println( "  Duration        : " + DateUtil.getDuration( stats.getDuration() ) );
-            System.out.println( "  When Gathered   : " + df.format( stats.getWhenGathered() ) );
-            System.out.println( "  Total File Count: " + stats.getTotalFileCount() );
-            System.out.println( "  New File Count  : " + stats.getNewFileCount() );
-            System.out.println( "______________________________________________________________" );
-        }
-        catch ( RepositoryException e )
-        {
-            e.printStackTrace( System.err );
-        }
-    }
-
-    class POMConsumer extends AbstractMonitoredConsumer implements RepositoryContentConsumer
-    {
-        private int count = 0;
-
-        private ProjectModelReader reader;
-
-        private ArchivaRepository repo;
-
-        public POMConsumer()
-        {
-            reader = new ProjectModel400Reader();
-        }
-
-        public List getExcludes()
-        {
-            return Collections.EMPTY_LIST;
-        }
-
-        public List getIncludes()
-        {
-            List includes = new ArrayList();
-            includes.add( "**/*.pom" );
-            return includes;
-        }
-
-        public String getId()
-        {
-            return "pom-consumer";
-        }
-
-        public String getDescription()
-        {
-            return "Basic POM Consumer";
-        }
-
-        public boolean isPermanent()
-        {
-            return false;
-        }
-
-        public void beginScan( ArchivaRepository repository ) throws ConsumerException
-        {
-            repo = repository;
-        }
-
-        public void processFile( String path ) throws ConsumerException
-        {
-            count++;
-            if ( ( count % 1000 ) == 0 )
-            {
-                System.out.println( "Files Processed: " + count );
-            }
-
-            File pomFile = new File( repo.getUrl().getPath(), path );
-            try
-            {
-                ArchivaProjectModel model = reader.read( pomFile );
-            }
-            catch ( ProjectModelException e )
-            {
-                System.err.println( "Unable to process: " + pomFile );
-                e.printStackTrace( System.out );
-            }
-        }
-
-        public void completeScan()
-        {
-            /* do nothing */
-        }
-    }
-
-    class BasicConsumer extends AbstractMonitoredConsumer implements RepositoryContentConsumer
-    {
-        int count = 0;
-
-        public List getExcludes()
-        {
-            return Collections.EMPTY_LIST;
-        }
-
-        public List getIncludes()
-        {
-            List includes = new ArrayList();
-            includes.add( "**/*.pom" );
-            includes.add( "**/*.jar" );
-            includes.add( "**/*.war" );
-            includes.add( "**/*.ear" );
-            includes.add( "**/*.sar" );
-            includes.add( "**/*.car" );
-            includes.add( "**/*.mar" );
-            //            includes.add( "**/*.sha1" );
-            //            includes.add( "**/*.md5" );
-            //            includes.add( "**/*.asc" );
-            includes.add( "**/*.dtd" );
-            includes.add( "**/*.tld" );
-            includes.add( "**/*.gz" );
-            includes.add( "**/*.bz2" );
-            includes.add( "**/*.zip" );
-            return includes;
-        }
-
-        public String getId()
-        {
-            return "test-scan-timing";
-        }
-
-        public String getDescription()
-        {
-            return "Basic No-op Consumer";
-        }
-
-        public boolean isPermanent()
-        {
-            return false;
-        }
-
-        public void beginScan( ArchivaRepository repository ) throws ConsumerException
-        {
-            /* do nothing */
-        }
-
-        public void processFile( String path ) throws ConsumerException
-        {
-            count++;
-            if ( ( count % 1000 ) == 0 )
-            {
-                System.out.println( "Files Processed: " + count );
-            }
-        }
-
-        public void completeScan()
-        {
-            /* do nothing */
-        }
-    }
-}
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..d48ebf7
--- /dev/null
@@ -0,0 +1,69 @@
+<?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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>archiva-applet</artifactId>
+  <name>Archiva Applet</name>
+  <description>
+    Applet for performing local operations on files such as creating a checksum of an artifact
+    before uploading it.
+  </description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+        <configuration>
+          <keystore>src/keystore/keystore</keystore>
+          <alias>mykey</alias>
+          <storepass>password</storepass>
+          <keypass>password</keypass>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>sign</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- TODO: should this module have tests? -->
+            <excludes>
+              <exclude>**/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..cd51f1e
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>archiva-base</artifactId>
+  <name>Archiva Base</name>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>archiva-common</module>
+    <module>archiva-configuration</module>
+    <module>archiva-consumers</module>
+    <module>archiva-indexer</module>
+    <module>archiva-model</module>
+    <!-- <module>archiva-proxy</module> -->
+    <module>archiva-repository-layer</module>
+    <module>archiva-xml-tools</module>
+  </modules>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..115bc99
--- /dev/null
@@ -0,0 +1,68 @@
+<?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.
+  -->
+
+<project>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-cli</artifactId>
+  <name>Archiva Command Line Client</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-converter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-repository-layer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-cli</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptor>src/main/assembly/archiva-cli-assembly.xml</descriptor>
+          <archive>
+            <manifest>
+              <mainClass>org.apache.maven.archiva.cli.ArchivaCli</mainClass>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..17a20ab
--- /dev/null
@@ -0,0 +1,98 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-common</artifactId>
+  <name>Archiva Base :: Common</name>
+  <dependencies>
+    <!-- TO OTHER DEVELOPERS:
+         This module should depend on NO OTHER ARCHIVA MODULES.
+         If you feel tempted to add one, discuss it first in the 
+         archiva-dev@maven.apache.org mailing-list.
+            joakime@apache.org
+      -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <!-- 
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+    </dependency>
+      -->
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <!--
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>test-jar</id>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+       -->
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <!--
+        <executions>
+          <execution>
+            <id>merge</id>
+            <goals>
+              <goal>merge-descriptors</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+                <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+         -->
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..790d0cf
--- /dev/null
@@ -0,0 +1,109 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-configuration</artifactId>
+  <name>Archiva Base :: Configuration</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.registry</groupId>
+      <artifactId>plexus-registry-api</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.registry</groupId>
+      <artifactId>plexus-registry-commons</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- Test Deps -->
+    <dependency>
+      <groupId>easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>1.2_Java1.3</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-15-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+              <goal>registry-reader</goal>
+              <goal>registry-writer</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/configuration.mdo</model>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- exclude generated -->
+            <excludes>
+              <exclude>org/apache/maven/archiva/configuration/io/**</exclude>
+              <exclude>org/apache/maven/archiva/configuration/*RepositoryConfiguration.*</exclude>
+              <exclude>org/apache/maven/archiva/configuration/Configuration.*</exclude>
+              <exclude>org/apache/maven/archiva/configuration/Proxy.*</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..f331ed0
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-consumers</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>archiva-consumer-api</artifactId>
+  <name>Archiva Consumer API</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-model</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..8969b9e
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>archiva-consumers</artifactId>
+  <name>Archiva Consumers</name>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>archiva-consumer-api</module>
+    <module>archiva-core-consumers</module>
+    <!--
+    <module>archiva-database-consumers</module>
+    <module>archiva-lucene-consumers</module>
+    <module>archiva-signature-consumers</module>
+     -->
+  </modules>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..49bde7b
--- /dev/null
@@ -0,0 +1,79 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-converter</artifactId>
+  <name>Archiva Repository Converter</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-discoverer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-model-converter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-i18n</artifactId>
+      <version>1.0-beta-6</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <!-- TEST DEPS -->
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.7.3.3</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- Needed for PlexusTestCase -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..182578f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-consumers</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <artifactId>archiva-core-consumers</artifactId>
+  <name>Archiva Consumers :: Core Consumers</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-consumer-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-repository-layer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..18b98fc
--- /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">
+  <parent>
+    <artifactId>archiva</artifactId>
+    <groupId>org.apache.maven.archiva</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-core</artifactId>
+  <name>Archiva Core</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-discoverer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-proxy</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-reports-standard</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-quartz</artifactId>
+      <version>1.0-alpha-3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.cache</groupId>
+      <artifactId>plexus-cache-ehcache</artifactId>
+      <version>1.0-alpha-1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-taskqueue</artifactId>
+      <version>1.0-alpha-6</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+       <dependency>
+      <groupId>org.codehaus.plexus.registry</groupId>
+      <artifactId>plexus-registry-commons</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>    
+       <!-- TEST DEPS -->
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.7.3.3</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- needed for PlexusTestCase -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>merge</id>
+            <goals>
+              <goal>merge-descriptors</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+                <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..8a96e39
--- /dev/null
@@ -0,0 +1,65 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-discoverer</artifactId>
+  <name>Archiva Discoverer</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..7d77d44
--- /dev/null
@@ -0,0 +1,81 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-indexer</artifactId>
+  <name>Archiva Base :: Indexer</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-configuration</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-model</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-core</artifactId>
+      <version>2.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <check>
+            <!-- TODO: increase coverage -->
+            <totalLineRate>80</totalLineRate>
+            <totalBranchRate>80</totalBranchRate>
+          </check>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..52c185e
--- /dev/null
@@ -0,0 +1,159 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-model</artifactId>
+  <name>Archiva Base :: Model</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.jdo</groupId>
+      <artifactId>jdo2-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-15-SNAPSHOT</version>
+        <configuration>
+          <version>1.0.0</version>
+          <packageWithVersion>false</packageWithVersion>
+          <model>src/main/mdo/archiva-base.xml</model>
+        </configuration>
+        <executions>
+          <execution>
+            <id>archiva-base</id>
+            <goals>
+              <goal>java</goal>
+              <goal>xsd</goal>
+              <goal>jpox-jdo-mapping</goal>
+              <goal>jpox-metadata-class</goal>
+              <!--
+              <goal>xpp3-writer</goal>
+              <goal>xpp3-reader</goal>
+                -->
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+       <groupId>org.codehaus.mojo</groupId>
+        <artifactId>jpox-maven-plugin</artifactId>
+        <version>1.1.6</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.2.1.6</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>create-ddl</id>
+            <phase>generate-test-resources</phase>
+            <goals>
+              <goal>schema-create</goal>
+            </goals>
+            <configuration>
+              <outputFile>${basedir}/target/classes/org/apache/maven/archiva/model/schema.ddl</outputFile>
+              <toolProperties>
+                <property>
+                  <name>javax.jdo.option.ConnectionDriverName</name>
+                  <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionURL</name>
+                  <value>jdbc:derby:target/jdo-schema-create;create=true</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionUserName</name>
+                  <value>sa</value>
+                </property>
+                <property>
+                  <name>javax.jdo.option.ConnectionPassword</name>
+                  <value></value>
+                </property>
+                <property>
+                  <name>log4j.configuration</name>
+                  <value>${basedir}/src/test/resources/log4j.xml</value>
+                </property>
+                <property>
+                  <name>org.jpox.autoCreateTables</name>
+                  <value>true</value>
+                </property>
+              </toolProperties>
+            </configuration>
+          </execution>
+          <execution>
+            <id>enhance</id>
+            <goals>
+              <goal>enhance</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- exclude generated -->
+            <excludes>
+              <exclude>org/apache/maven/archiva/reporting/model/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..c3a69b1
--- /dev/null
@@ -0,0 +1,567 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-parent</artifactId>
+    <version>4</version>
+    <relativePath>../pom/maven/pom.xml</relativePath>
+  </parent>
+  <groupId>org.apache.maven.archiva</groupId>
+  <artifactId>archiva-parent</artifactId>
+  <packaging>pom</packaging>
+  <name>Archiva</name>
+  <version>1.0-SNAPSHOT</version>
+  <description>
+    Archiva is an application for managing one or more remote repositories, including
+    administration, artifact handling,
+    browsing and searching.
+  </description>
+  <url>http://maven.apache.org/archiva</url>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/MRM</url>
+  </issueManagement>
+  <mailingLists>
+    <mailingList>
+      <name>Maven Archiva User List</name>
+      <subscribe>archiva-users-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-users-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-users@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-users</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Developer List</name>
+      <subscribe>archiva-dev-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-dev-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-dev@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-dev</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Commits List</name>
+      <subscribe>archiva-commits-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-commits-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-commits@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-commits</archive>
+    </mailingList>
+  </mailingLists>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk</url>
+  </scm>
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <url>scpexe://people.apache.org/www/maven.apache.org/archiva/</url>
+    </site>
+  </distributionManagement>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <version>1.3.3</version>
+        <executions>
+          <execution>
+            <id>generate</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <target>1.4</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-idea-plugin</artifactId>
+          <configuration>
+            <jdkLevel>1.4</jdkLevel>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-release-plugin</artifactId>
+          <configuration>
+            <tagBase>https://svn.apache.org/repos/asf/maven/archiva/tags</tagBase>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  <modules>
+    <module>archiva-api</module>
+    <module>archiva-base</module>
+    <module>archiva-database</module>
+    <module>archiva-reporting</module>
+    <module>archiva-web</module>
+    <module>archiva-cli</module>
+    <module>maven-meeper</module>
+  </modules>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-web</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-container-default</artifactId>
+        <version>1.0-alpha-18</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-api</artifactId>
+        <version>1.0-alpha-18</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-utils</artifactId>
+        <version>1.4</version>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-log4j12</artifactId>
+        <version>1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-repository-metadata</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-model</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact-manager</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-project</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-model-converter</artifactId>
+        <version>2.0.5-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-provider-api</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-ssh</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-file</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-http-lightweight</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-core</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-reports-standard</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-model</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-database</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-consumer-api</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-model</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-database</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-discoverer</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-repository-layer</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-indexer</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-proxy</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-applet</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-security</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-configuration</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-converter</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-utils</artifactId>
+        <version>${archiva.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-webapp</artifactId>
+        <version>${archiva.version}</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-digest</artifactId>
+        <version>1.1-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-rbac-profile</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web</artifactId>
+        <version>${plexus-security.version}</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-integration</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-taglib</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-user-manager</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-keystore</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-api</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-provider-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-cached</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-api</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-keys-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.2</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.derby</groupId>
+        <artifactId>derby</artifactId>
+        <version>10.1.3.1</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>config/maven_checks.xml</configLocation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>changelog-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-jxr-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <!-- TODO: choose appropriate rulesets -->
+      </plugin>
+    </plugins>
+  </reporting>
+  <profiles>
+    <profile>
+      <id>ci</id>
+      <activation>
+        <property>
+          <name>enableCiProfile</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-pmd-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: after rules are set
+                                    <goal>check</goal>
+                  -->
+                  <goal>cpd-check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-checkstyle-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: reformat first, and correct the checks (some are not consistent with the Maven style)
+                                    <goal>check</goal>
+                  -->
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>cobertura-maven-plugin</artifactId>
+            <configuration>
+              <check>
+                <!-- TODO! raise to 85/100 -->
+                <totalLineRate>77</totalLineRate>
+                <totalBranchRate>95</totalBranchRate>
+              </check>
+
+              <instrumentation>
+                <excludes>
+                  <exclude>**/*$*</exclude>
+                </excludes>
+              </instrumentation>
+            </configuration>
+            <executions>
+              <execution>
+                <id>clean</id>
+                <goals>
+                  <goal>clean</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>check</id>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  <repositories>
+    <repository>
+      <id>codehaus.org</id>
+      <url>http://repository.codehaus.org</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+    <!-- TODO: remove once ehcache, p-sec, registry, webdav, xwork, naming released -->
+    <repository>
+      <id>snapshots.codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  <!-- TODO: remove once modello is released -->
+  <pluginRepositories>
+    <pluginRepository>
+      <id>snapshots.codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
+  <properties>
+    <archiva.version>1.0-SNAPSHOT</archiva.version>
+    <maven.version>2.0.5</maven.version>
+    <wagon.version>1.0-beta-2</wagon.version>
+    <plexus-security.version>1.0-alpha-11-SNAPSHOT</plexus-security.version>
+  </properties>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..21edbff
--- /dev/null
@@ -0,0 +1,62 @@
+<?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">
+  <parent>
+    <artifactId>archiva</artifactId>
+    <groupId>org.apache.maven.archiva</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-plexus-application</artifactId>
+  <packaging>plexus-application</packaging>
+  <name>Archiva Plexus Application</name>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-appserver-maven-plugin</artifactId>
+        <version>2.0-alpha-7</version>
+        <extensions>true</extensions>
+        <configuration>
+          <applicationConfiguration>src/conf/application.xml</applicationConfiguration>
+          <configurationsDirectory>src/conf</configurationsDirectory>
+          <configurationProperties>src/plexus.properties</configurationProperties>
+          <applicationName>archiva</applicationName>
+          <runtimeConfiguration>src/conf/plexus.xml</runtimeConfiguration>
+          <runtimeConfigurationProperties>src/plexus.properties</runtimeConfigurationProperties>
+          <runtimePath>target/plexus-archiva-runtime</runtimePath>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-webapp</artifactId>
+      <type>war</type>
+    </dependency>
+  </dependencies>
+  <!-- For filtering -->
+  <properties>
+    <archivaVersion>${project.version}</archivaVersion>
+  </properties>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..1c675dc
--- /dev/null
@@ -0,0 +1,145 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-plexus-runtime</artifactId>
+  <name>Archiva Runtime Generator</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-appserver-host</artifactId>
+      <version>2.0-alpha-7</version>
+    </dependency>
+    <!-- Services -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-appserver-service-jetty</artifactId>
+      <version>2.0-alpha-7</version>
+      <type>plexus-service</type>
+    </dependency>
+    <!-- Plexus applications -->
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-plexus-application</artifactId>
+      <version>${project.version}</version>
+      <type>plexus-application</type>
+    </dependency>
+
+    <!-- Additional Core Artifacts -->
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.8</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging-api</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-naming</artifactId>
+      <version>1.0-alpha-3-SNAPSHOT</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.mail</groupId>
+      <artifactId>mail</artifactId>
+      <version>1.4</version>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-appserver-maven-plugin</artifactId>
+        <version>2.0-alpha-7</version>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>assemble-runtime</goal>
+              <goal>add-services</goal>
+              <goal>add-apps</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <runtimeConfiguration>src/conf/plexus.xml</runtimeConfiguration>
+          <runtimeConfigurationProperties>src/plexus.properties</runtimeConfigurationProperties>
+          <runtimePath>target/plexus-archiva-runtime</runtimePath>
+          <additionalCoreArtifacts>
+            <additionalCoreArtifact>commons-logging:commons-logging-api</additionalCoreArtifact>
+            <additionalCoreArtifact>log4j:log4j</additionalCoreArtifact>
+            <additionalCoreArtifact>org.apache.derby:derby</additionalCoreArtifact>
+            <additionalCoreArtifact>org.codehaus.plexus:plexus-naming</additionalCoreArtifact>
+            <additionalCoreArtifact>commons-pool:commons-pool</additionalCoreArtifact>
+            <additionalCoreArtifact>commons-dbcp:commons-dbcp</additionalCoreArtifact>
+            <additionalCoreArtifact>commons-collections:commons-collections</additionalCoreArtifact>
+            <additionalCoreArtifact>directory-naming:naming-core</additionalCoreArtifact>
+            <additionalCoreArtifact>directory-naming:naming-factory</additionalCoreArtifact>
+            <additionalCoreArtifact>directory-naming:naming-java</additionalCoreArtifact>
+            <additionalCoreArtifact>directory-naming:naming-config</additionalCoreArtifact>
+            <additionalCoreArtifact>javax.mail:mail</additionalCoreArtifact>
+            <additionalCoreArtifact>javax.activation:activation</additionalCoreArtifact>
+          </additionalCoreArtifacts>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <descriptor>src/main/assembly/bin.xml</descriptor>
+          <finalName>archiva</finalName>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..23488ee
--- /dev/null
@@ -0,0 +1,60 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-proxy</artifactId>
+  <name>Archiva Proxy</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-digest</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <version>1.2_Java1.3</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..24eb199
--- /dev/null
@@ -0,0 +1,176 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-reports-standard</artifactId>
+  <name>Archiva Standard Reports</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-provider-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-repository-layer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-indexer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-discoverer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-jdo2</artifactId>
+      <version>1.0-alpha-8</version>
+      <exclusions>
+        <exclusion>
+          <groupId>xerces</groupId>
+          <artifactId>xercesImpl</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>xerces</groupId>
+          <artifactId>xmlParserAPIs</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>jpox</groupId>
+      <artifactId>jpox</artifactId>
+      <version>1.1.6</version>
+      <scope>compile</scope>
+      <exclusions>
+        <!-- targeting JDK 1.4 we don't need this -->
+        <exclusion>
+          <groupId>javax.sql</groupId>
+          <artifactId>jdbc-stdext</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <!--  TEST DEPS -->
+    <dependency>
+      <groupId>hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>1.7.3.3</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-14-SNAPSHOT</version>
+        <configuration>
+          <version>1.0.0</version>
+          <packageWithVersion>false</packageWithVersion>
+          <model>src/main/mdo/reporting.mdo</model>
+        </configuration>
+        <executions>
+          <execution>
+            <id>modello-java</id>
+            <goals>
+              <goal>java</goal>
+              <goal>jpox-metadata-class</goal>
+              <!--
+              <goal>xpp3-writer</goal>
+              <goal>xpp3-reader</goal>
+               -->
+            </goals>
+          </execution>
+          <execution>
+            <id>jpox-jdo-mapping</id>
+            <goals>
+              <goal>jpox-jdo-mapping</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/target/classes/org/apache/maven/archiva/reporting/model/</outputDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+       <groupId>org.codehaus.mojo</groupId>
+        <artifactId>jpox-maven-plugin</artifactId>
+        <version>1.1.6-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>enhance</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <configuration>
+          <instrumentation>
+            <!-- exclude generated -->
+            <excludes>
+              <exclude>org/apache/maven/archiva/reporting/model/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..6ec87f4
--- /dev/null
@@ -0,0 +1,103 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-repository-layer</artifactId>
+  <name>Archiva Repository Interface Layer</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-consumer-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-model</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-xml-tools</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.cache</groupId>
+      <artifactId>plexus-cache-api</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.cache</groupId>
+      <artifactId>plexus-cache-ehcache</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+      <scope>compile</scope>
+    </dependency>
+    <!-- 
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact-manager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-repository-metadata</artifactId>
+    </dependency>
+     -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>merge</id>
+            <goals>
+              <goal>merge-descriptors</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+                <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..78cbd12
--- /dev/null
@@ -0,0 +1,45 @@
+<?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">
+  <parent>
+    <artifactId>archiva</artifactId>
+    <groupId>org.apache.maven.archiva</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-security</artifactId>
+  <name>Archiva Security Configuration</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-rbac-profile</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-system</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..2d58dbf
--- /dev/null
@@ -0,0 +1,335 @@
+<?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>
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>archiva-webapp</artifactId>
+  <packaging>war</packaging>
+  <name>Archiva Web Application</name>
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jsp-api</artifactId>
+      <version>2.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>opensymphony</groupId>
+      <artifactId>sitemesh</artifactId>
+      <version>2.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>taglibs</groupId>
+      <artifactId>standard</artifactId>
+      <version>1.1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jstl</artifactId>
+      <version>1.1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-app-configuration-model</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-app-configuration-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-log4j-logging</artifactId>
+      <version>1.1-alpha-2</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-http-lightweight</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-file</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>opensymphony</groupId>
+      <artifactId>webwork</artifactId>
+      <version>2.2.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.registry</groupId>
+      <artifactId>plexus-registry-commons</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-proxy</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-security</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-applet</artifactId>
+      <!-- TODO: actually, just exclude from WAR plugin -->
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-dependency-tree</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>
+    <!-- Plexus Security Dependencies -->
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-ui-web</artifactId>
+      <type>war</type>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-ui-web-taglib</artifactId>
+    </dependency>
+    <!-- Other dependencies -->
+    <dependency>
+      <groupId>org.codehaus.plexus.webdav</groupId>
+      <artifactId>plexus-webdav-simple</artifactId>
+      <version>1.0-alpha-1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-xwork-integration</artifactId>
+      <version>1.0-alpha-5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <version>10.1.3.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.mail</groupId>
+      <artifactId>mail</artifactId>
+      <version>1.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.activation</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.1</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-clean-plugin</artifactId>
+        <version>2.1.1</version>
+        <!-- This configuration is added to cleanup from war:inplace -->
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>${basedir}/src/main/webapp</directory>
+              <includes>
+                <!-- TODO: META-INF shouldn't be required, seems to be an issue with the current war plugin -->
+                <include>META-INF</include>
+                <include>images/pss</include>
+                <!-- Images from other wars -->
+                <include>template/pss</include>
+                <!-- Templates from other wars -->
+                <include>WEB-INF/classes</include>
+                <!-- Classes and Resources from other wars -->
+                <include>WEB-INF/lib</include>
+                <!-- Dependencies from other wars -->
+                <include>WEB-INF/database</include>
+                <!-- Database location configured in application.xml -->
+                <include>WEB-INF/logs</include>
+                <!-- Log file location specified in application.xml -->
+                <include>pss</include>
+                <!-- plexus-security css and javascript -->
+                <include>css/pss</include>
+                <include>WEB-INF/jsp/pss</include>
+                <!-- plexus-security jsps -->
+                <include>WEB-INF/template/pss</include>
+                <!-- plexus-security xwork templates -->
+                <include>WEB-INF/logs</include>
+                <!-- Directory created by jetty:run -->
+                <include>WEB-INF/temp</include>
+                <!-- Directory created by jetty:run -->
+              </includes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.0.1</version>
+        <configuration>
+          <!-- Some versions of maven-war-plugin (snapshots) have this incorrectly defaulted to true.
+               Specifically setting this to false to avoid accidental jar file creation. -->
+          <archiveClasses>false</archiveClasses>
+          <dependentWarExcludes>META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml</dependentWarExcludes>
+        </configuration>
+        <!-- TODO: would be good to make the jetty plugin aware of these and remove the below -->
+        <executions>
+          <execution>
+            <phase>compile</phase>
+            <goals>
+              <!-- Needed to get the plexus-security war overlay to do its thing before jetty:run -->
+              <goal>inplace</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <version>6.1.1</version>
+        <configuration>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <contextPath>/</contextPath>
+          <jettyEnvXml>src/jetty-env.xml</jettyEnvXml>
+          <connectors>
+            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+              <port>9091</port>
+              <maxIdleTime>60000</maxIdleTime>
+            </connector>
+          </connectors>
+          <systemProperties>
+            <systemProperty>
+              <name>appserver.base</name>
+              <value>${project.build.directory}/appserver-base</value>
+            </systemProperty>
+            <systemProperty>
+              <name>derby.system.home</name>
+              <value>${project.build.directory}/appserver-base/logs</value>
+            </systemProperty>
+          </systemProperties>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.1.3.1</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>dependency-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>archiva-applet</artifactId>
+                  <version>${project.version}</version>
+                  <outputDirectory>src/main/webapp</outputDirectory>
+                  <destFileName>archiva-applet.jar</destFileName>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <configuration>
+          <roleDefaults>
+            <roleDefault>
+              <role>com.opensymphony.xwork.Action</role>
+              <instantiation-strategy>per-lookup</instantiation-strategy>
+            </roleDefault>
+          </roleDefaults>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+        <!-- TODO! add unit tests -->
+        <configuration>
+          <instrumentation>
+            <excludes>
+              <exclude>**/**</exclude>
+            </excludes>
+          </instrumentation>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..efa42d3
--- /dev/null
@@ -0,0 +1,79 @@
+<?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">
+  <parent>
+    <groupId>org.apache.maven.archiva</groupId>
+    <artifactId>archiva-base</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>archiva-xml-tools</artifactId>
+  <name>Archiva Base :: XML Tools</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.6.1</version>
+    </dependency>
+    <dependency>
+      <groupId>jaxen</groupId>
+      <artifactId>jaxen</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+  </dependencies>
+  <!--
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>merge</id>
+            <goals>
+              <goal>merge-descriptors</goal>
+            </goals>
+            <configuration>
+              <descriptors>
+                <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor>
+                <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+   -->
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom
new file mode 100644 (file)
index 0000000..b990010
--- /dev/null
@@ -0,0 +1,506 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  ~ Copyright 2005-2006 The Apache Software Foundation.\r
+  ~\r
+  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
+  ~ you may not use this file except in compliance with the License.\r
+  ~ You may obtain a copy of the License at\r
+  ~\r
+  ~      http://www.apache.org/licenses/LICENSE-2.0\r
+  ~\r
+  ~ Unless required by applicable law or agreed to in writing, software\r
+  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  ~ See the License for the specific language governing permissions and\r
+  ~ limitations under the License.\r
+  -->\r
+\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
+  <modelVersion>4.0.0</modelVersion>\r
+  <parent>\r
+    <groupId>org.apache.maven</groupId>\r
+    <artifactId>maven-parent</artifactId>\r
+    <version>4</version>\r
+    <relativePath>../pom/maven/pom.xml</relativePath>\r
+  </parent>\r
+  <groupId>org.apache.maven.archiva</groupId>\r
+  <artifactId>archiva</artifactId>\r
+  <packaging>pom</packaging>\r
+  <name>Archiva</name>\r
+  <version>1.0-SNAPSHOT</version>\r
+  <description>\r
+    Archiva is an application for managing one or more remote repositories, including\r
+    administration, artifact handling,\r
+    browsing and searching.\r
+  </description>\r
+  <url>http://maven.apache.org/archiva</url>\r
+  <issueManagement>\r
+    <system>jira</system>\r
+    <url>http://jira.codehaus.org/browse/MRM</url>\r
+  </issueManagement>\r
+  <mailingLists>\r
+    <mailingList>\r
+      <name>Maven Archiva User List</name>\r
+      <subscribe>archiva-users-subscribe@maven.apache.org</subscribe>\r
+      <unsubscribe>archiva-users-unsubscribe@maven.apache.org</unsubscribe>\r
+      <post>archiva-users@maven.apache.org</post>\r
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-users</archive>\r
+    </mailingList>\r
+    <mailingList>\r
+      <name>Maven Archiva Developer List</name>\r
+      <subscribe>archiva-dev-subscribe@maven.apache.org</subscribe>\r
+      <unsubscribe>archiva-dev-unsubscribe@maven.apache.org</unsubscribe>\r
+      <post>archiva-dev@maven.apache.org</post>\r
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-dev</archive>\r
+    </mailingList>\r
+    <mailingList>\r
+      <name>Maven Archiva Commits List</name>\r
+      <subscribe>archiva-commits-subscribe@maven.apache.org</subscribe>\r
+      <unsubscribe>archiva-commits-unsubscribe@maven.apache.org</unsubscribe>\r
+      <post>archiva-commits@maven.apache.org</post>\r
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-commits</archive>\r
+    </mailingList>\r
+  </mailingLists>\r
+  <scm>\r
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk</connection>\r
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk</developerConnection>\r
+    <url>http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk</url>\r
+  </scm>\r
+  <distributionManagement>\r
+    <site>\r
+      <id>apache.website</id>\r
+      <url>scpexe://people.apache.org/www/maven.apache.org/archiva/</url>\r
+    </site>\r
+  </distributionManagement>\r
+  <build>\r
+  <extensions>\r
+    <extension>\r
+      <groupId>org.apache.maven.wagon</groupId>\r
+      <artifactId>wagon-ssh-external</artifactId>\r
+      <version>1.0-alpha-5</version>\r
+    </extension>\r
+  </extensions>\r
+    <plugins>\r
+      <plugin>\r
+        <groupId>org.codehaus.plexus</groupId>\r
+        <artifactId>plexus-maven-plugin</artifactId>\r
+        <version>1.3</version>\r
+        <executions>\r
+          <execution>\r
+            <goals>\r
+              <goal>descriptor</goal>\r
+              <goal>merge-descriptors</goal>\r
+            </goals>\r
+          </execution>\r
+        </executions>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-compiler-plugin</artifactId>\r
+        <configuration>\r
+          <source>1.4</source>\r
+          <target>1.4</target>\r
+        </configuration>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-surefire-plugin</artifactId>\r
+        <version>2.2</version>\r
+      </plugin>\r
+    </plugins>\r
+    <pluginManagement>\r
+      <plugins>\r
+        <plugin>\r
+          <artifactId>maven-idea-plugin</artifactId>\r
+          <configuration>\r
+            <jdkLevel>1.4</jdkLevel>\r
+          </configuration>\r
+        </plugin>\r
+        <plugin>\r
+          <artifactId>maven-release-plugin</artifactId>\r
+          <configuration>\r
+            <tagBase>https://svn.apache.org/repos/asf/maven/archiva/tags</tagBase>\r
+          </configuration>\r
+        </plugin>\r
+      </plugins>\r
+    </pluginManagement>\r
+  </build>\r
+  <modules>\r
+    <module>archiva-applet</module>\r
+    <module>archiva-converter</module>\r
+    <module>archiva-discoverer</module>\r
+    <module>archiva-reports-standard</module>\r
+    <module>archiva-indexer</module>\r
+    <module>archiva-webapp</module>\r
+    <module>archiva-proxy</module>\r
+    <module>archiva-core</module>\r
+    <module>archiva-configuration</module>\r
+    <module>maven-meeper</module>\r
+    <module>archiva-repository-layer</module>\r
+    <module>archiva-plexus-application</module>\r
+    <module>archiva-plexus-runtime</module>\r
+    <module>archiva-security</module>\r
+    <module>archiva-cli</module>\r
+  </modules>\r
+  <dependencies>\r
+    <dependency>\r
+      <groupId>junit</groupId>\r
+      <artifactId>junit</artifactId>\r
+      <version>3.8.1</version>\r
+      <scope>test</scope>\r
+    </dependency>\r
+  </dependencies>\r
+  <dependencyManagement>\r
+    <dependencies>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus</groupId>\r
+        <artifactId>plexus-container-default</artifactId>\r
+        <version>1.0-alpha-10</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus</groupId>\r
+        <artifactId>plexus-utils</artifactId>\r
+        <version>1.3</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-repository-metadata</artifactId>\r
+        <version>${maven.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-model</artifactId>\r
+        <version>${maven.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-artifact</artifactId>\r
+        <version>${maven.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-artifact-manager</artifactId>\r
+        <version>${maven.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-project</artifactId>\r
+        <version>${maven.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven</groupId>\r
+        <artifactId>maven-model-converter</artifactId>\r
+        <version>2.0.4</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.wagon</groupId>\r
+        <artifactId>wagon-provider-api</artifactId>\r
+        <version>${wagon.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.wagon</groupId>\r
+        <artifactId>wagon-ssh</artifactId>\r
+        <version>${wagon.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.wagon</groupId>\r
+        <artifactId>wagon-file</artifactId>\r
+        <version>${wagon.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.wagon</groupId>\r
+        <artifactId>wagon-http-lightweight</artifactId>\r
+        <version>${wagon.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-core</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-reports-standard</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-discoverer</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-repository-layer</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-indexer</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-proxy</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-applet</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-security</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-configuration</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-converter</artifactId>\r
+        <version>${pom.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.apache.maven.archiva</groupId>\r
+        <artifactId>archiva-webapp</artifactId>\r
+        <version>${pom.version}</version>\r
+        <type>war</type>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus</groupId>\r
+        <artifactId>plexus-digest</artifactId>\r
+        <version>1.0-SNAPSHOT</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-rbac-profile</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-system</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-system</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-ui-web</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+        <type>war</type>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-ui-web-integration</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-ui-web-taglib</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-authentication-provider-user-manager</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-authentication-provider-keystore</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-user-management-api</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-user-management-provider-jdo</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-authorization-rbac-store-jdo</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-authorization-api</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+      <dependency>\r
+        <groupId>org.codehaus.plexus.security</groupId>\r
+        <artifactId>plexus-security-keys-jdo</artifactId>\r
+        <version>${plexus-security.version}</version>\r
+      </dependency>\r
+    </dependencies>\r
+  </dependencyManagement>\r
+  <reporting>\r
+    <plugins>\r
+      <plugin>\r
+        <groupId>org.codehaus.mojo</groupId>\r
+        <artifactId>cobertura-maven-plugin</artifactId>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-checkstyle-plugin</artifactId>\r
+        <configuration>\r
+          <configLocation>config/maven_checks.xml</configLocation>\r
+        </configuration>\r
+      </plugin>\r
+      <plugin>\r
+        <groupId>org.codehaus.mojo</groupId>\r
+        <artifactId>changelog-maven-plugin</artifactId>\r
+      </plugin>\r
+      <plugin>\r
+        <groupId>org.codehaus.mojo</groupId>\r
+        <artifactId>taglist-maven-plugin</artifactId>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-jxr-plugin</artifactId>\r
+        <configuration>\r
+          <aggregate>true</aggregate>\r
+        </configuration>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-surefire-report-plugin</artifactId>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-javadoc-plugin</artifactId>\r
+        <configuration>\r
+          <aggregate>true</aggregate>\r
+        </configuration>\r
+      </plugin>\r
+      <plugin>\r
+        <artifactId>maven-pmd-plugin</artifactId>\r
+        <!-- TODO: choose appropriate rulesets -->\r
+      </plugin>\r
+    </plugins>\r
+  </reporting>\r
+  <profiles>\r
+    <profile>\r
+      <id>ci</id>\r
+      <activation>\r
+        <property>\r
+          <name>enableCiProfile</name>\r
+          <value>true</value>\r
+        </property>\r
+      </activation>\r
+      <build>\r
+        <plugins>\r
+          <plugin>\r
+            <groupId>org.apache.maven.plugins</groupId>\r
+            <artifactId>maven-pmd-plugin</artifactId>\r
+            <executions>\r
+              <execution>\r
+                <phase>process-sources</phase>\r
+                <goals>\r
+                  <!-- TODO: after rules are set\r
+                                    <goal>check</goal>\r
+                  -->\r
+                  <goal>cpd-check</goal>\r
+                </goals>\r
+              </execution>\r
+            </executions>\r
+          </plugin>\r
+          <plugin>\r
+            <groupId>org.apache.maven.plugins</groupId>\r
+            <artifactId>maven-checkstyle-plugin</artifactId>\r
+            <executions>\r
+              <execution>\r
+                <phase>process-sources</phase>\r
+                <goals>\r
+                  <!-- TODO: reformat first, and correct the checks (some are not consistent with the Maven style)\r
+                                    <goal>check</goal>\r
+                  -->\r
+                </goals>\r
+              </execution>\r
+            </executions>\r
+          </plugin>\r
+          <plugin>\r
+            <groupId>org.codehaus.mojo</groupId>\r
+            <artifactId>cobertura-maven-plugin</artifactId>\r
+            <configuration>\r
+              <check>\r
+                <!-- TODO! raise to 85/100 -->\r
+                <totalLineRate>77</totalLineRate>\r
+                <totalBranchRate>95</totalBranchRate>\r
+              </check>\r
+\r
+              <instrumentation>\r
+                <excludes>\r
+                  <exclude>**/*$*</exclude>\r
+                </excludes>\r
+              </instrumentation>\r
+            </configuration>\r
+            <executions>\r
+              <execution>\r
+                <id>clean</id>\r
+                <goals>\r
+                  <goal>clean</goal>\r
+                </goals>\r
+              </execution>\r
+              <execution>\r
+                <id>check</id>\r
+                <goals>\r
+                  <goal>check</goal>\r
+                </goals>\r
+              </execution>\r
+            </executions>\r
+          </plugin>\r
+        </plugins>\r
+      </build>\r
+    </profile>\r
+  </profiles>\r
+  <!-- TODO: remove once xwork integration, plexus container is released -->\r
+  <repositories>\r
+    <repository>\r
+      <id>codehaus.org</id>\r
+      <url>http://snapshots.repository.codehaus.org</url>\r
+      <releases>\r
+        <enabled>false</enabled>\r
+      </releases>\r
+      <snapshots>\r
+        <enabled>true</enabled>\r
+      </snapshots>\r
+    </repository>\r
+  </repositories>\r
+  <pluginRepositories>\r
+    <pluginRepository>\r
+      <id>codehaus.org</id>\r
+      <url>http://snapshots.repository.codehaus.org</url>\r
+      <releases>\r
+        <enabled>false</enabled>\r
+      </releases>\r
+      <snapshots>\r
+        <enabled>true</enabled>\r
+      </snapshots>\r
+    </pluginRepository>\r
+\r
+    <!-- See: http://www.nabble.com/NoClassDefFoundError-from-shared-in-project-info-reports-tf2678299s177.html#a7489595 -->\r
+    <pluginRepository>\r
+      <id>apache.org</id>\r
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>\r
+      <releases>\r
+        <enabled>false</enabled>\r
+      </releases>\r
+      <snapshots>\r
+        <enabled>true</enabled>\r
+      </snapshots>\r
+    </pluginRepository>\r
+  </pluginRepositories>\r
+  <properties>\r
+    <maven.version>2.0.4</maven.version>\r
+    <wagon.version>1.0-beta-1</wagon.version>\r
+    <plexus-security.version>1.0-alpha-6-SNAPSHOT</plexus-security.version>\r
+  </properties>\r
+</project>\r
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml
new file mode 100644 (file)
index 0000000..ac3c2e7
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?><project>
+  <bannerLeft>
+    <name>Maven</name>
+    <src>http://maven.apache.org/images/apache-maven-project-2.png</src>
+    <href>http://maven.apache.org/</href>
+  </bannerLeft>
+  <bannerRight>
+    <src>images/archiva-logo-banner.jpg</src>
+  </bannerRight>
+  <publishDate format="dd MMM yyyy" />
+  <skin>
+    <groupId>org.apache.maven.skins</groupId>
+    <artifactId>maven-stylus-skin</artifactId>
+  </skin>
+  <body>
+    <links>
+      <item name="Maven" href="http://maven.apache.org/" />
+    </links>
+    <menu name="Documentation">
+      <item name="Welcome" href="/index.html" />
+      <item name="Getting Started" href="/guides/getting-started/index.html" />
+      <item name="FAQ" href="http://docs.codehaus.org/display/MAVENUSER/Archiva+FAQ" />
+      <item name="Maven Configuration" href="/guides/getting-started/maven-configuration.html" />
+      <item name="Developing" href="/guides/developing/index.html" />
+    </menu>
+    <menu inherit="bottom" ref="reports" />
+  </body>
+</project>
\ No newline at end of file
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom
new file mode 100644 (file)
index 0000000..4992be1
--- /dev/null
@@ -0,0 +1,557 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache.maven</groupId>
+    <artifactId>maven-parent</artifactId>
+    <version>4</version>
+    <relativePath>../pom/maven/pom.xml</relativePath>
+  </parent>
+  <prerequisites>
+    <maven>2.0.5</maven>
+  </prerequisites>
+  <groupId>org.apache.maven.archiva</groupId>
+  <artifactId>archiva</artifactId>
+  <packaging>pom</packaging>
+  <name>Archiva</name>
+  <version>1.0-SNAPSHOT</version>
+  <description>
+    Archiva is an application for managing one or more remote repositories, including
+    administration, artifact handling,
+    browsing and searching.
+  </description>
+  <url>http://maven.apache.org/archiva</url>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/MRM</url>
+  </issueManagement>
+  <mailingLists>
+    <mailingList>
+      <name>Maven Archiva User List</name>
+      <subscribe>archiva-users-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-users-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-users@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-users</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Developer List</name>
+      <subscribe>archiva-dev-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-dev-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-dev@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-dev</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Archiva Commits List</name>
+      <subscribe>archiva-commits-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>archiva-commits-unsubscribe@maven.apache.org</unsubscribe>
+      <post>archiva-commits@maven.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-archiva-commits</archive>
+    </mailingList>
+  </mailingLists>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk</developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk</url>
+  </scm>
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <url>scpexe://people.apache.org/www/maven.apache.org/archiva/</url>
+    </site>
+  </distributionManagement>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-maven-plugin</artifactId>
+        <version>1.3.3</version>
+        <executions>
+          <execution>
+            <id>generate</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <target>1.4</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-idea-plugin</artifactId>
+          <configuration>
+            <jdkLevel>1.4</jdkLevel>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-release-plugin</artifactId>
+          <configuration>
+            <tagBase>https://svn.apache.org/repos/asf/maven/archiva/tags</tagBase>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  <modules>
+    <module>archiva-applet</module>
+    <module>archiva-converter</module>
+    <module>archiva-common</module>
+    <module>archiva-discoverer</module>
+    <module>archiva-reports-standard</module>
+    <module>archiva-indexer</module>
+    <module>archiva-webapp</module>
+    <module>archiva-proxy</module>
+    <module>archiva-core</module>
+    <module>archiva-configuration</module>
+    <module>maven-meeper</module>
+    <module>archiva-repository-layer</module>
+    <module>archiva-plexus-application</module>
+    <module>archiva-plexus-runtime</module>
+    <module>archiva-security</module>
+    <module>archiva-cli</module>
+  </modules>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-app-configuration-web</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-container-default</artifactId>
+        <version>1.0-alpha-17</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-api</artifactId>
+        <version>1.0-alpha-17</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-utils</artifactId>
+        <version>1.4</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-repository-metadata</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-model</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-artifact-manager</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-project</artifactId>
+        <version>${maven.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-model-converter</artifactId>
+        <version>2.0.5-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-provider-api</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-ssh</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-file</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-http-lightweight</artifactId>
+        <version>${wagon.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <!--
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-common</artifactId>
+        <version>${pom.version}</version>
+        <classifier>tests</classifier>
+        <scope>test</scope>
+      </dependency>
+       -->
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-core</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-reports-standard</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-discoverer</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-repository-layer</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-indexer</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-proxy</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-applet</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-security</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-configuration</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-converter</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-utils</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.archiva</groupId>
+        <artifactId>archiva-webapp</artifactId>
+        <version>${pom.version}</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-digest</artifactId>
+        <version>1.0</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-rbac-profile</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-system</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web</artifactId>
+        <version>${plexus-security.version}</version>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-integration</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-ui-web-taglib</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-user-manager</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authentication-provider-keystore</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-api</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-user-management-provider-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-cached</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-store-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-api</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus.security</groupId>
+        <artifactId>plexus-security-keys-jdo</artifactId>
+        <version>${plexus-security.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.2</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>1.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.derby</groupId>
+        <artifactId>derby</artifactId>
+        <version>10.1.3.1</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>config/maven_checks.xml</configLocation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>changelog-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-jxr-plugin</artifactId>
+        <configuration>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <source>1.4</source>
+          <aggregate>true</aggregate>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <!-- TODO: choose appropriate rulesets -->
+      </plugin>
+    </plugins>
+  </reporting>
+  <profiles>
+    <profile>
+      <id>ci</id>
+      <activation>
+        <property>
+          <name>enableCiProfile</name>
+          <value>true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-pmd-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: after rules are set
+                                    <goal>check</goal>
+                  -->
+                  <goal>cpd-check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-checkstyle-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>process-sources</phase>
+                <goals>
+                  <!-- TODO: reformat first, and correct the checks (some are not consistent with the Maven style)
+                                    <goal>check</goal>
+                  -->
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>cobertura-maven-plugin</artifactId>
+            <configuration>
+              <check>
+                <!-- TODO! raise to 85/100 -->
+                <totalLineRate>77</totalLineRate>
+                <totalBranchRate>95</totalBranchRate>
+              </check>
+
+              <instrumentation>
+                <excludes>
+                  <exclude>**/*$*</exclude>
+                </excludes>
+              </instrumentation>
+            </configuration>
+            <executions>
+              <execution>
+                <id>clean</id>
+                <goals>
+                  <goal>clean</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>check</id>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  <repositories>
+    <repository>
+      <id>codehaus.org</id>
+      <url>http://repository.codehaus.org</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+    <!-- TODO: remove once ehcache, p-sec, registry, webdav, xwork, naming released -->
+    <repository>
+      <id>codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  <!-- TODO: remove once modello is released -->
+  <pluginRepositories>
+    <pluginRepository>
+      <id>codehaus.org</id>
+      <url>http://snapshots.repository.codehaus.org</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </pluginRepository>
+  </pluginRepositories>
+  <properties>
+    <maven.version>2.0.5</maven.version>
+    <wagon.version>1.0-beta-2</wagon.version>
+    <plexus-security.version>1.0-alpha-10-SNAPSHOT</plexus-security.version>
+  </properties>
+</project>
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site.xml b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site_en.xml b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site_en.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom
new file mode 100644 (file)
index 0000000..132d9d7
--- /dev/null
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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>
+  <parent>
+    <groupId>org.apache</groupId>
+    <artifactId>apache</artifactId>
+    <version>3</version>
+    <relativePath>../asf/pom.xml</relativePath>
+  </parent>
+  <groupId>org.apache.maven</groupId>
+  <artifactId>maven-parent</artifactId>
+  <version>4</version>
+  <packaging>pom</packaging>
+  <name>Apache Maven</name>
+  <description>
+    Maven is a software project management and comprehension tool. Based on the concept of a project object model
+    (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
+  </description>
+  <url>http://maven.apache.org/</url>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/MPA</url>
+  </issueManagement>
+  <ciManagement>
+    <system>continuum</system>
+    <url>http://maven.zones.apache.org:8080/continuum</url>
+    <notifiers>
+      <notifier>
+        <type>mail</type>
+        <configuration>
+          <address>notifications@maven.apache.org</address>
+        </configuration>
+      </notifier>
+    </notifiers>
+  </ciManagement>
+  <inceptionYear>2002</inceptionYear>
+  <mailingLists>
+    <mailingList>
+      <name>Maven Announcements List</name>
+      <post>announce@maven.apache.org</post>
+      <subscribe>announce-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Issues List</name>
+      <post>issues@maven.apache.org</post>
+      <subscribe>issues-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
+    </mailingList>
+    <mailingList>
+      <name>Maven Notifications List</name>
+      <post>notifications@maven.apache.org</post>
+      <subscribe>notifications-subscribe@maven.apache.org</subscribe>
+      <unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
+    </mailingList>
+  </mailingLists>
+
+  <developers>
+    <developer>
+      <id>jvanzyl</id>
+      <name>Jason van Zyl</name>
+      <email>jason@maven.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Chair</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>brett</id>
+      <name>Brett Porter</name>
+      <email>brett@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+10</timezone>
+    </developer>
+    <developer>
+      <id>evenisse</id>
+      <name>Emmanuel Venisse</name>
+      <email>evenisse@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>kenney</id>
+      <name>Kenney Westerhof</name>
+      <email>kenney@apache.org</email>
+      <organization>Neonics</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+    </developer>
+    <developer>
+      <id>snicoll</id>
+      <name>Stephane Nicoll</name>
+      <email>snicoll@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>vmassol</id>
+      <name>Vincent Massol</name>
+      <email>vmassol@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>fgiust</id>
+      <name>Fabrizio Giustina</name>
+      <email>fgiust@apache.org</email>
+      <organization>openmind</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>epunzalan</id>
+      <name>Edwin Punzalan</name>
+      <email>epunzalan@mergere.com</email>
+      <organization>Mergere</organization>
+      <roles>
+        <role>Committer</role>
+      </roles>
+      <timezone>+8</timezone>
+    </developer>
+    <developer>
+      <id>mperham</id>
+      <name>Mike Perham</name>
+      <email>mperham@gmail.com</email>
+      <organization>IBM</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-6</timezone>
+    </developer>
+    <developer>
+      <id>jdcasey</id>
+      <name>John Casey</name>
+      <email>jdcasey@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>trygvis</id>
+      <name>Trygve Laugstol</name>
+      <email>trygvis@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>vsiveton</id>
+      <name>Vincent Siveton</name>
+      <email>vsiveton@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>-5</timezone>
+    </developer>
+    <developer>
+      <id>carlos</id>
+      <name>Carlos Sanchez</name>
+      <email>carlos@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+    <developer>
+      <id>dennisl</id>
+      <name>Dennis Lundberg</name>
+      <email>dennisl@apache.org</email>
+      <organization>ASF</organization>
+      <roles>
+        <role>PMC Member</role>
+      </roles>
+      <timezone>+1</timezone>
+    </developer>
+  </developers>
+
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <url>scp://people.apache.org/www/maven.apache.org</url>
+    </site>
+  </distributionManagement>
+
+<!-- Disabled until projects have been made to comply
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>cpd-check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+-->
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml</configLocation>
+          <headerLocation>http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt</headerLocation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>cobertura-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jxr-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <links>
+            <link>http://java.sun.com/j2ee/1.4/docs/api</link>
+            <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+            <link>http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/</link>
+            <link>http://jakarta.apache.org/commons/dbcp/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/fileupload/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
+            <link>http://jakarta.apache.org/commons/pool/apidocs/</link>
+            <link>http://www.junit.org/junit/javadoc/</link>
+            <link>http://logging.apache.org/log4j/docs/api/</link>
+            <link>http://jakarta.apache.org/regexp/apidocs/</link>
+            <link>http://jakarta.apache.org/velocity/api/</link>
+          </links>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4</developerConnection>
+    <url>http://svn.apache.org/viewvc/maven/pom/maven/tags/maven-parent-4</url>
+  </scm>
+</project>
+
diff --git a/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 b/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1
new file mode 100644 (file)
index 0000000..b6caacf
--- /dev/null
@@ -0,0 +1 @@
+0fc039b0bd4d17d7c147a30e1d83994629c5297c
\ No newline at end of file
index e06f872c7210b09da98fb6c508486eb79112b9e5..6985ef06ad6e1ddeb4ac04dc553835e19b95fb62 100644 (file)
@@ -20,10 +20,13 @@ package org.apache.maven.archiva.xml;
  */
 
 import org.apache.commons.lang.StringUtils;
+import org.dom4j.Attribute;
 import org.dom4j.Document;
 import org.dom4j.DocumentException;
 import org.dom4j.Element;
+import org.dom4j.Namespace;
 import org.dom4j.Node;
+import org.dom4j.QName;
 import org.dom4j.XPath;
 import org.dom4j.io.SAXReader;
 
@@ -34,8 +37,10 @@ import java.io.InputStreamReader;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 /**
  * XMLReader - a set of common xml utility methods for reading content out of an xml file. 
@@ -51,6 +56,8 @@ public class XMLReader
 
     private Document document;
 
+    private Map namespaceMap = new HashMap();
+
     public XMLReader( String type, File file )
         throws XMLException
     {
@@ -121,10 +128,21 @@ public class XMLReader
         }
     }
 
+    public String getDefaultNamespaceURI()
+    {
+        Namespace namespace = this.document.getRootElement().getNamespace();
+        return namespace.getURI();
+    }
+
+    public void addNamespaceMapping( String elementName, String uri )
+    {
+        this.namespaceMap.put( elementName, uri );
+    }
+
     public Element getElement( String xpathExpr )
         throws XMLException
     {
-        XPath xpath = document.createXPath( xpathExpr );
+        XPath xpath = createXPath( xpathExpr );
         Object evaluated = xpath.selectSingleNode( document );
 
         if ( evaluated == null )
@@ -145,10 +163,20 @@ public class XMLReader
         }
     }
 
+    private XPath createXPath( String xpathExpr )
+    {
+        XPath xpath = document.createXPath( xpathExpr );
+        if ( !this.namespaceMap.isEmpty() )
+        {
+            xpath.setNamespaceURIs( this.namespaceMap );
+        }
+        return xpath;
+    }
+
     public boolean hasElement( String xpathExpr )
         throws XMLException
     {
-        XPath xpath = document.createXPath( xpathExpr );
+        XPath xpath = createXPath( xpathExpr );
         Object evaluated = xpath.selectSingleNode( document );
 
         if ( evaluated == null )
@@ -159,10 +187,44 @@ public class XMLReader
         return true;
     }
 
+    /**
+     * Remove namespaces from entire document.
+     */
+    public void removeNamespaces()
+    {
+        removeNamespaces( this.document.getRootElement() );
+    }
+
+    /**
+     * Remove namespaces from element recursively.
+     */
+    public void removeNamespaces( Element elem )
+    {
+        elem.setQName( QName.get( elem.getName(), Namespace.NO_NAMESPACE, elem.getQualifiedName() ) );
+
+        Node n;
+
+        Iterator it = elem.elementIterator();
+        while ( it.hasNext() )
+        {
+            n = (Node) it.next();
+
+            switch ( n.getNodeType() )
+            {
+                case Node.ATTRIBUTE_NODE:
+                    ( (Attribute) n ).setNamespace( Namespace.NO_NAMESPACE );
+                    break;
+                case Node.ELEMENT_NODE:
+                    removeNamespaces( (Element) n );
+                    break;
+            }
+        }
+    }
+
     public String getElementText( Node context, String xpathExpr )
         throws XMLException
     {
-        XPath xpath = document.createXPath( xpathExpr );
+        XPath xpath = createXPath( xpathExpr );
         Object evaluated = xpath.selectSingleNode( context );
 
         if ( evaluated == null )
@@ -186,7 +248,7 @@ public class XMLReader
     public String getElementText( String xpathExpr )
         throws XMLException
     {
-        XPath xpath = document.createXPath( xpathExpr );
+        XPath xpath = createXPath( xpathExpr );
         Object evaluated = xpath.selectSingleNode( document );
 
         if ( evaluated == null )
@@ -210,7 +272,7 @@ public class XMLReader
     public List getElementList( String xpathExpr )
         throws XMLException
     {
-        XPath xpath = document.createXPath( xpathExpr );
+        XPath xpath = createXPath( xpathExpr );
         Object evaluated = xpath.evaluate( document );
 
         if ( evaluated == null )
@@ -230,7 +292,7 @@ public class XMLReader
         else if ( evaluated instanceof Node )
         {
             List ret = new ArrayList();
-            ret.add( (Node) evaluated );
+            ret.add( evaluated );
             return ret;
         }
         else
index 7832ff5be28a679a99b9ccde7d1530f24b92cc60..23c66cef057126efc3fbbb421bed911d297c0f6d 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.repository.project.ProjectModel400Reader;
 import org.apache.maven.archiva.repository.project.ProjectModelException;
 import org.apache.maven.archiva.repository.project.ProjectModelReader;
+import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
 
 import java.io.File;
 import java.util.ArrayList;
diff --git a/archiva-consumer-api/pom.xml b/archiva-consumer-api/pom.xml
deleted file mode 100755 (executable)
index e20018f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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">
-  <parent>
-    <groupId>org.apache.maven.archiva</groupId>
-    <artifactId>archiva</artifactId>
-    <version>1.0-SNAPSHOT</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>archiva-consumer-api-OLD</artifactId>
-  <name>Archiva Consumer API</name>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.maven.archiva</groupId>
-      <artifactId>archiva-model</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-maven-plugin</artifactId>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractConsumerTestCase.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractConsumerTestCase.java
deleted file mode 100644 (file)
index a6a90e3..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.maven.archiva.repository.ArchivaRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * AbstractConsumerTestCase 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class AbstractConsumerTestCase extends PlexusTestCase
-{
-    protected ArchivaRepository getLegacyRepository() throws Exception
-    {
-        File repoBaseDir = new File( getBasedir(), "src/test/legacy-repository" );
-        ArchivaRepository repository = createRepository( repoBaseDir, "legacy" );
-        resetRepositoryState( repository );
-        return repository;
-    }
-
-    protected ArchivaRepository getDefaultRepository() throws Exception
-    {
-        File repoBaseDir = new File( getBasedir(), "src/test/repository" );
-        ArchivaRepository repository = createRepository( repoBaseDir, "default" );
-        resetRepositoryState( repository );
-        return repository;
-    }
-
-    private void resetRepositoryState( ArchivaRepository repository ) throws IOException
-    {
-        File repoBaseDir = new File( repository.getRepositoryURL().getPath() );
-
-        List tmpfiles = FileUtils.getFiles( repoBaseDir, ".*", "" );
-        for ( Iterator it = tmpfiles.iterator(); it.hasNext(); )
-        {
-            File hit = (File) it.next();
-            if ( hit.exists() )
-            {
-                if ( hit.isFile() )
-                {
-                    hit.delete();
-                }
-
-                if ( hit.isDirectory() )
-                {
-                    FileUtils.deleteDirectory( hit );
-                }
-            }
-        }
-    }
-
-    protected ArchivaRepository createRepository( File basedir, String layout ) throws Exception
-    {
-        ArtifactRepositoryLayout repoLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, layout );
-
-        ArchivaRepository repo = new ArchivaRepository();
-        repo.setId( "discoveryRepo" );
-        repo.setUrl( "file://" + basedir );
-        repo.setLayout( repoLayout );
-
-        return repo;
-    }
-
-    public List getLegacyLayoutArtifactPaths()
-    {
-        List files = new ArrayList();
-
-        files.add( "invalid/jars/1.0/invalid-1.0.jar" );
-        files.add( "invalid/jars/invalid-1.0.rar" );
-        files.add( "invalid/jars/invalid.jar" );
-        files.add( "invalid/invalid-1.0.jar" );
-        files.add( "javax.sql/jars/jdbc-2.0.jar" );
-        files.add( "org.apache.maven/jars/some-ejb-1.0-client.jar" );
-        files.add( "org.apache.maven/jars/testing-1.0.jar" );
-        files.add( "org.apache.maven/jars/testing-1.0-sources.jar" );
-        files.add( "org.apache.maven/jars/testing-UNKNOWN.jar" );
-        files.add( "org.apache.maven/jars/testing-1.0.zip" );
-        files.add( "org.apache.maven/jars/testing-1.0-20050611.112233-1.jar" );
-        files.add( "org.apache.maven/jars/testing-1.0.tar.gz" );
-        files.add( "org.apache.maven.update/jars/test-not-updated-1.0.jar" );
-        files.add( "org.apache.maven.update/jars/test-updated-1.0.jar" );
-
-        return files;
-    }
-    
-    public List getDefaultLayoutArtifactPaths()
-    {
-        List files = new ArrayList();
-
-        files.add( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" );
-        files.add( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar" );
-        files.add( "invalid/invalid/1.0/invalid-1.0b.jar" );
-        files.add( "invalid/invalid/1.0/invalid-2.0.jar" );
-        files.add( "invalid/invalid-1.0.jar" );
-        files.add( "org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar" );
-        files.add( "org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar" );
-        files.add( "org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar" );
-        files.add( "org/apache/maven/A/1.0/A-1.0.war" );
-        files.add( "org/apache/maven/A/1.0/A-1.0.pom" );
-        files.add( "org/apache/maven/B/2.0/B-2.0.pom" );
-        files.add( "org/apache/maven/B/1.0/B-1.0.pom" );
-        files.add( "org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar" );
-        files.add( "org/apache/maven/C/1.0/C-1.0.war" );
-        files.add( "org/apache/maven/C/1.0/C-1.0.pom" );
-        files.add( "org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom" );
-        files.add( "org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar" );
-        files.add( "org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom" );
-        files.add( "org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar" );
-        files.add( "org/apache/maven/discovery/1.0/discovery-1.0.pom" );
-        files.add( "org/apache/maven/testing/1.0/testing-1.0-test-sources.jar" );
-        files.add( "org/apache/maven/testing/1.0/testing-1.0.jar" );
-        files.add( "org/apache/maven/testing/1.0/testing-1.0-sources.jar" );
-        files.add( "org/apache/maven/testing/1.0/testing-1.0.zip" );
-        files.add( "org/apache/maven/testing/1.0/testing-1.0.tar.gz" );
-        files.add( "org/apache/maven/samplejar/2.0/samplejar-2.0.pom" );
-        files.add( "org/apache/maven/samplejar/2.0/samplejar-2.0.jar" );
-        files.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" );
-        files.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.jar" );
-        files.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" );
-        files.add( "javax/sql/jdbc/2.0/jdbc-2.0.jar" );
-
-        return files;
-    }
-}
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractGenericConsumerTestCase.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AbstractGenericConsumerTestCase.java
deleted file mode 100644 (file)
index bbb5610..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-import org.apache.maven.archiva.repository.consumer.ConsumerFactory;
-
-/*
- * 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.
- */
-
-
-/**
- * AbstractGenericConsumerTestCase 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public abstract class AbstractGenericConsumerTestCase
-    extends AbstractConsumerTestCase
-{
-    protected ConsumerFactory consumerFactory;
-
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-
-        consumerFactory = (ConsumerFactory) lookup( ConsumerFactory.ROLE );
-    }
-
-    protected void tearDown()
-        throws Exception
-    {
-        if ( consumerFactory != null )
-        {
-            release( consumerFactory );
-        }
-        super.tearDown();
-    }
-}
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AllTests.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/AllTests.java
deleted file mode 100644 (file)
index 783fb85..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * AllTests 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class AllTests
-{
-
-    public static Test suite()
-    {
-        TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.common.consumers" );
-        //$JUnit-BEGIN$
-        suite.addTestSuite( GenericArtifactConsumerTest.class );
-        //$JUnit-END$
-        return suite;
-    }
-
-}
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/FileProblemsTracker.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/FileProblemsTracker.java
deleted file mode 100644 (file)
index bc96f03..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.repository.consumer.ConsumerException;
-import org.codehaus.plexus.util.StringUtils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * FileProblemsTracker
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class FileProblemsTracker
-{
-    private Map problemMap = new HashMap();
-
-    public void addProblem( BaseFile file, String message )
-    {
-        String path = file.getRelativePath();
-        addProblem( path, message );
-    }
-
-    private void addProblem( String path, String message )
-    {
-        path = StringUtils.replace( path, "\\", "/" );
-        List problems = getProblems( path );
-        problems.add( message );
-        problemMap.put( path, problems );
-    }
-
-    public void addProblem( ConsumerException e )
-    {
-        if ( e.getFile() != null )
-        {
-            this.addProblem( e.getFile(), e.getMessage() );
-        }
-        else
-        {
-            this.addProblem( "|fatal|", e.getMessage() );
-        }
-    }
-
-    public boolean hasProblems( String path )
-    {
-        if ( !problemMap.containsKey( path ) )
-        {
-            // No tracking of path at all.
-            return false;
-        }
-
-        List problems = (List) problemMap.get( path );
-        if ( problems == null )
-        {
-            // found path, but no list.
-            return false;
-        }
-
-        return !problems.isEmpty();
-    }
-
-    public Set getPaths()
-    {
-        return problemMap.keySet();
-    }
-
-    public List getProblems( String path )
-    {
-        List problems = (List) problemMap.get( path );
-        if ( problems == null )
-        {
-            problems = new ArrayList();
-        }
-
-        return problems;
-    }
-
-    public int getProblemCount()
-    {
-        int count = 0;
-        for ( Iterator it = problemMap.values().iterator(); it.hasNext(); )
-        {
-            List problems = (List) it.next();
-            count += problems.size();
-        }
-
-        return count;
-    }
-
-}
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/GenericArtifactConsumerTest.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/GenericArtifactConsumerTest.java
deleted file mode 100644 (file)
index a436cdd..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.repository.ArchivaRepository;
-import org.apache.maven.archiva.repository.consumer.ConsumerException;
-import org.apache.maven.artifact.Artifact;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * GenericArtifactConsumerTest 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class GenericArtifactConsumerTest
-    extends AbstractGenericConsumerTestCase
-{
-    private MockArtifactConsumer getMockArtifactConsumer()
-        throws Exception
-    {
-        return (MockArtifactConsumer) consumerFactory.createConsumer( "mock-artifact" );
-    }
-
-    public void testScanLegacy()
-        throws Exception
-    {
-        ArchivaRepository repository = getLegacyRepository();
-        List consumers = new ArrayList();
-
-        MockArtifactConsumer mockConsumer = getMockArtifactConsumer();
-        mockConsumer.init( repository );
-
-        consumers.add( mockConsumer );
-
-        List files = getLegacyLayoutArtifactPaths();
-        for ( Iterator it = files.iterator(); it.hasNext(); )
-        {
-            String path = (String) it.next();
-            try
-            {
-                mockConsumer.processFile( new BaseFile( repository.getRepositoryURL().getPath(), path ) );
-            }
-            catch ( ConsumerException e )
-            {
-                mockConsumer.getProblemsTracker().addProblem( e );
-            }
-        }
-
-        assertNotNull( consumers );
-
-        FileProblemsTracker tracker = mockConsumer.getProblemsTracker();
-
-        assertTracker( tracker, 16 );
-
-        assertHasFailureMessage( "Path does not match a legacy repository path for an artifact",
-                                 "invalid/invalid-1.0.jar", tracker );
-        assertHasFailureMessage( "Path filename version is empty", "invalid/jars/invalid.jar", tracker );
-        assertHasFailureMessage( "Path does not match a legacy repository path for an artifact",
-                                 "invalid/jars/1.0/invalid-1.0.jar", tracker );
-
-        assertEquals( 10, mockConsumer.getArtifactMap().size() );
-    }
-
-    public void testScanDefault()
-        throws Exception
-    {
-        ArchivaRepository repository = getDefaultRepository();
-        List consumers = new ArrayList();
-
-        MockArtifactConsumer mockConsumer = getMockArtifactConsumer();
-        mockConsumer.init( repository );
-
-        consumers.add( mockConsumer );
-
-        List files = getDefaultLayoutArtifactPaths();
-        for ( Iterator it = files.iterator(); it.hasNext(); )
-        {
-            String path = (String) it.next();
-            try
-            {
-                mockConsumer.processFile( new BaseFile( repository.getRepositoryURL().getPath(), path ) );
-            }
-            catch ( ConsumerException e )
-            {
-                mockConsumer.getProblemsTracker().addProblem( e );
-            }
-        }
-
-        // Test gathered information from Mock consumer.
-
-        assertNotNull( consumers );
-
-        FileProblemsTracker tracker = mockConsumer.getProblemsTracker();
-
-        assertTracker( tracker, 21 );
-
-        assertHasFailureMessage( "Failed to create a snapshot artifact: invalid:invalid:jar:1.0:runtime",
-                                 "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar", tracker );
-        assertHasFailureMessage( "Path is too short to build an artifact from.", "invalid/invalid-1.0.jar", tracker );
-        assertHasFailureMessage( "Built artifact version does not match path version",
-                                 "invalid/invalid/1.0/invalid-2.0.jar", tracker );
-
-        assertEquals( 25, mockConsumer.getArtifactMap().size() );
-
-        // Test for known include artifacts
-
-        Collection artifacts = mockConsumer.getArtifactMap().values();
-        assertHasArtifact( "org.apache.maven", "testing", "1.0", "jar", null, artifacts );
-        assertHasArtifact( "org.apache.maven", "some-ejb", "1.0", "jar", "client", artifacts );
-        assertHasArtifact( "org.apache.maven", "testing", "1.0", "java-source", "sources", artifacts );
-        assertHasArtifact( "org.apache.maven", "testing", "1.0", "java-source", "test-sources", artifacts );
-        assertHasArtifact( "org.apache.maven", "testing", "1.0", "distribution-zip", null, artifacts );
-        assertHasArtifact( "org.apache.maven", "testing", "1.0", "distribution-tgz", null, artifacts );
-        assertHasArtifact( "javax.sql", "jdbc", "2.0", "jar", null, artifacts );
-        assertHasArtifact( "org.apache.maven", "test", "1.0-20050611.112233-1", "jar", null, artifacts );
-        assertHasArtifact( "org.apache.maven", "test", "1.0-20050611.112233-1", "jar", "javadoc", artifacts );
-
-        // Test for known excluded files and dirs to validate exclusions.
-
-        Iterator it = mockConsumer.getArtifactMap().values().iterator();
-        while ( it.hasNext() )
-        {
-            Artifact a = (Artifact) it.next();
-            assertTrue( "Artifact " + a + " should have it's .getFile() set.", a.getFile() != null );
-            assertTrue( "Artifact " + a + " should have it's .getRepository() set.", a.getRepository() != null );
-            assertTrue( "Artifact " + a + " should have non-null repository url.", a.getRepository().getUrl() != null );
-            assertFalse( "Check not CVS", a.getFile().getPath().indexOf( "CVS" ) >= 0 );
-            assertFalse( "Check not .svn", a.getFile().getPath().indexOf( ".svn" ) >= 0 );
-        }
-    }
-
-    private void dumpProblems( FileProblemsTracker tracker )
-    {
-        int problemNum = 0;
-        System.out.println( "-- ProblemTracker dump -------------------------" );
-        for ( Iterator itPaths = tracker.getPaths().iterator(); itPaths.hasNext(); )
-        {
-            String path = (String) itPaths.next();
-            System.out.println( " [" + problemNum + "]: " + path );
-
-            int messageNum = 0;
-            for ( Iterator itProblems = tracker.getProblems( path ).iterator(); itProblems.hasNext(); )
-            {
-                String message = (String) itProblems.next();
-                System.out.println( "    [" + messageNum + "]: " + message );
-                messageNum++;
-            }
-
-            problemNum++;
-        }
-    }
-
-    private void assertTracker( FileProblemsTracker tracker, int expectedProblemCount )
-    {
-        assertNotNull( "ProblemsTracker should not be null.", tracker );
-
-        int actualProblemCount = tracker.getProblemCount();
-        if ( expectedProblemCount != actualProblemCount )
-        {
-            dumpProblems( tracker );
-            fail( "Problem count (across all paths) expected:<" + expectedProblemCount + ">, actual:<"
-                + actualProblemCount + ">" );
-        }
-    }
-
-    private void assertHasFailureMessage( String message, String path, FileProblemsTracker tracker )
-    {
-        if ( !tracker.hasProblems( path ) )
-        {
-            fail( "There are no messages for expected path [" + path + "]" );
-        }
-
-        assertTrue( "Unable to find message [" + message + "] in path [" + path + "]", tracker.getProblems( path )
-            .contains( message ) );
-    }
-
-    private void assertHasArtifact( String groupId, String artifactId, String version, String type, String classifier,
-                                    Collection collection )
-    {
-        for ( Iterator it = collection.iterator(); it.hasNext(); )
-        {
-            Artifact artifact = (Artifact) it.next();
-            if ( StringUtils.equals( groupId, artifact.getGroupId() )
-                && StringUtils.equals( artifactId, artifact.getArtifactId() )
-                && StringUtils.equals( version, artifact.getVersion() )
-                && StringUtils.equals( type, artifact.getType() )
-                && StringUtils.equals( classifier, artifact.getClassifier() ) )
-            {
-                // Found it!
-                return;
-            }
-        }
-
-        fail( "Was unable to find artifact " + groupId + ":" + artifactId + ":" + version + ":" + type + ":"
-            + classifier );
-    }
-}
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockArtifactConsumer.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockArtifactConsumer.java
deleted file mode 100644 (file)
index 66ad9a2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.common.utils.PathUtil;
-import org.apache.maven.archiva.consumers.core.GenericArtifactConsumer;
-import org.apache.maven.artifact.Artifact;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * MockArtifactConsumer 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * 
- * @plexus.component role="org.apache.maven.archiva.common.consumers.Consumers"
- *     role-hint="mock-artifact"
- *     instantiation-strategy="per-lookup"
- */
-public class MockArtifactConsumer
-    extends GenericArtifactConsumer
-{
-    private Map artifactMap = new HashMap();
-
-    private FileProblemsTracker problemsTracker = new FileProblemsTracker();
-
-    public void processArtifact( Artifact artifact, BaseFile file )
-    {
-        String relpath = PathUtil.getRelative( repository.getRepositoryURL().getPath(), file );
-        artifactMap.put( relpath, artifact );
-    }
-
-    public void processFileProblem( BaseFile file, String message )
-    {
-        problemsTracker.addProblem( file, message );
-    }
-
-    public Map getArtifactMap()
-    {
-        return artifactMap;
-    }
-
-    public String getName()
-    {
-        return "Mock Artifact Consumer (Testing Only)";
-    }
-    
-    public FileProblemsTracker getProblemsTracker()
-    {
-        return problemsTracker;
-    }
-}
\ No newline at end of file
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockModelConsumer.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockModelConsumer.java
deleted file mode 100644 (file)
index 98adf8e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.consumers.core.GenericModelConsumer;
-import org.apache.maven.model.Model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * MockModelConsumer 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * 
- * @plexus.component role="org.apache.maven.archiva.common.consumers.Consumers"
- *     role-hint="mock-model"
- *     instantiation-strategy="per-lookup"
- */
-public class MockModelConsumer
-    extends GenericModelConsumer
-{
-    private Map modelMap = new HashMap();
-
-    private FileProblemsTracker problemsTracker = new FileProblemsTracker();
-
-    public void processModel( Model model, BaseFile file )
-    {
-        modelMap.put( file.getRelativePath(), model );
-    }
-
-    public void processFileProblem( BaseFile file, String message )
-    {
-        problemsTracker.addProblem( file, message );
-    }
-
-    public Map getModelMap()
-    {
-        return modelMap;
-    }
-
-    public String getName()
-    {
-        return "Mock Model Consumer (Testing Only)";
-    }
-
-    public FileProblemsTracker getProblemsTracker()
-    {
-        return problemsTracker;
-    }
-
-}
\ No newline at end of file
diff --git a/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockRepositoryMetadataConsumer.java b/archiva-consumer-api/src/test/java/org/apache/maven/archiva/consumers/MockRepositoryMetadataConsumer.java
deleted file mode 100644 (file)
index b58dc57..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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 org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.consumers.core.GenericRepositoryMetadataConsumer;
-import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * MockRepositoryMetadataConsumer 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- * 
- * @plexus.component role="org.apache.maven.archiva.common.consumers.Consumers"
- *     role-hint="mock-metadata"
- *     instantiation-strategy="per-lookup"
- */
-public class MockRepositoryMetadataConsumer
-    extends GenericRepositoryMetadataConsumer
-{
-    private Map repositoryMetadataMap = new HashMap();
-
-    private FileProblemsTracker problemsTracker = new FileProblemsTracker();
-
-    public void processRepositoryMetadata( RepositoryMetadata metadata, BaseFile file )
-    {
-        repositoryMetadataMap.put( file.getRelativePath(), metadata );
-    }
-
-    public void processFileProblem( BaseFile file, String message )
-    {
-        problemsTracker.addProblem( file, message );
-    }
-
-    public Map getRepositoryMetadataMap()
-    {
-        return repositoryMetadataMap;
-    }
-
-    public String getName()
-    {
-        return "Mock RepositoryMetadata Consumer (Testing Only)";
-    }
-
-    public FileProblemsTracker getProblemsTracker()
-    {
-        return problemsTracker;
-    }
-}
\ No newline at end of file
index 5dbd6bfe865488bae8a31e16376f1a245d113c9d..34db1d9bb401bbc76540dd14a1848d868ee1c5f5 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.maven.archiva.database;
 
 import org.apache.maven.archiva.model.ArchivaArtifactModel;
 import org.apache.maven.archiva.model.ArchivaRepositoryModel;
-import org.apache.maven.archiva.model.RepositoryContent;
 
 import java.util.List;
 
@@ -73,29 +72,13 @@ public interface ArchivaDAO
     public void deleteRepository( ArchivaRepositoryModel repository )
         throws ArchivaDatabaseException;
 
-    /* .\ Repository Content \.____________________________________________________________ */
-
-    public RepositoryContent createRepositoryContent( String groupId, String artifactId, String version,
-                                                      String repositoryId );
-
-    public RepositoryContent getRepositoryContent( String groupId, String artifactId, String version,
-                                                   String repositoryId )
-        throws ObjectNotFoundException, ArchivaDatabaseException;
-
-    public List /*<RepositoryContent>*/queryRepositoryContents( Constraint constraint )
-        throws ObjectNotFoundException, ArchivaDatabaseException;
-
-    public RepositoryContent saveRepositoryContent( RepositoryContent repoContent )
-        throws ArchivaDatabaseException;
-
-    public void deleteRepositoryContent( RepositoryContent repoContent )
-        throws ArchivaDatabaseException;
-
     /* .\ Archiva Artifact \. _____________________________________________________________ */
 
-    public ArchivaArtifactModel createArtifact( RepositoryContent repoContent, String classifier, String type );
+    public ArchivaArtifactModel createArtifact( String groupId, String artifactId, String version, String classifier,
+                                                String type );
 
-    public ArchivaArtifactModel getArtifact( RepositoryContent repoContent, String classifier, String type )
+    public ArchivaArtifactModel getArtifact( String groupId, String artifactId, String version, String classifier,
+                                             String type )
         throws ObjectNotFoundException, ArchivaDatabaseException;
 
     public List /*<ArchivaArtifactModel>*/queryArtifacts( Constraint constraint )
index 87565a825bccbdac6904a9ff925891749ed6c2c0..4eb9cd06e609bcbed0d749205bceab88e9a497e0 100644 (file)
@@ -6,8 +6,6 @@ import org.apache.maven.archiva.database.Constraint;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.model.ArchivaArtifactModel;
 import org.apache.maven.archiva.model.ArchivaRepositoryModel;
-import org.apache.maven.archiva.model.RepositoryContent;
-import org.apache.maven.archiva.model.RepositoryContentKey;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.List;
@@ -78,70 +76,22 @@ public class JdoArchivaDAO
         jdo.removeObject( repository );
     }
 
-    /* .\ Repository Content \.____________________________________________________________ */
-
-    public RepositoryContent createRepositoryContent( String groupId, String artifactId, String version,
-                                                      String repositoryId )
-    {
-        RepositoryContent repoContent;
-
-        try
-        {
-            repoContent = getRepositoryContent( groupId, artifactId, version, repositoryId );
-        }
-        catch ( ArchivaDatabaseException e )
-        {
-            repoContent = new RepositoryContent( repositoryId, groupId, artifactId, version );
-        }
-
-        return repoContent;
-    }
-
-    public RepositoryContent getRepositoryContent( String groupId, String artifactId, String version,
-                                                   String repositoryId )
-        throws ObjectNotFoundException, ArchivaDatabaseException
-    {
-        RepositoryContentKey key = new RepositoryContentKey();
-        key.groupId = groupId;
-        key.artifactId = artifactId;
-        key.version = version;
-        key.repositoryId = repositoryId;
-
-        return (RepositoryContent) jdo.getObjectById( RepositoryContent.class, key, null );
-    }
-
-    public List queryRepositoryContents( Constraint constraint )
-        throws ObjectNotFoundException, ArchivaDatabaseException
-    {
-        return jdo.getAllObjects( RepositoryContent.class, constraint );
-    }
-
-    public RepositoryContent saveRepositoryContent( RepositoryContent repoContent )
-        throws ArchivaDatabaseException
-    {
-        return (RepositoryContent) jdo.saveObject( repoContent );
-    }
-
-    public void deleteRepositoryContent( RepositoryContent repoContent )
-        throws ArchivaDatabaseException
-    {
-        jdo.removeObject( repoContent );
-    }
-
     /* .\ Archiva Artifact \. _____________________________________________________________ */
 
-    public ArchivaArtifactModel createArtifact( RepositoryContent repoContent, String classifier, String type )
+    public ArchivaArtifactModel createArtifact( String groupId, String artifactId, String version, String classifier, String type )
     {
         ArchivaArtifactModel artifact;
 
         try
         {
-            artifact = getArtifact( repoContent, classifier, type );
+            artifact = getArtifact( groupId, artifactId, version, classifier, type );
         }
         catch ( ArchivaDatabaseException e )
         {
             artifact = new ArchivaArtifactModel();
-            artifact.setContentKey( repoContent );
+            artifact.setGroupId( groupId );
+            artifact.setArtifactId( artifactId );
+            artifact.setVersion( version );
             artifact.setClassifier( classifier );
             artifact.setType( type );
         }
@@ -149,7 +99,7 @@ public class JdoArchivaDAO
         return artifact;
     }
 
-    public ArchivaArtifactModel getArtifact( RepositoryContent repoContent, String classifier, String type )
+    public ArchivaArtifactModel getArtifact( String groupId, String artifactId, String version, String classifier, String type )
         throws ObjectNotFoundException, ArchivaDatabaseException
     {