]> source.dussan.org Git - archiva.git/commitdiff
[MRM-952] (also fixes MRM-615, MRM-844 and MRM-620)
authorMaria Odea B. Ching <oching@apache.org>
Sat, 11 Oct 2008 03:56:18 +0000 (03:56 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sat, 11 Oct 2008 03:56:18 +0000 (03:56 +0000)
submitted by Michal Stochmialek
- fixes problems with expression resolving (${pom.version}) in dependencies,
- adds support for parent.{groupId, artifactId, version) properties,
- fixes issues with jdo detachCopy called from ProjectModelToDatabaseListener while creating effective pom,
- fixes inconsistency in key format used in effective model cache,
- add merging parentProject and properties while creating effective pom,
- ArchivaProjectModel.setOrgin("filesystem") was moved to readers (where IMO should be),
- adds few new test cases.

additional changes:
- applied codestyle formatting to patch

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@703626 13f79535-47bb-0310-9956-ffa450edef68

33 files changed:
archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionUtil.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.java [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.xml [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project/2.4.4/test-project-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/archiva-model-effective.pom
archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/test-project-model-effective.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/FilenameParserTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java
archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java
archiva-modules/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
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project/2.4.4/test-project-2.4.4.pom [new file with mode: 0644]
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/ProjectModelToDatabaseListener.java

index 2e3831d4a05053a65c66298865f7ea387757fa98..1ae5831f043fe9cb030e6dd2cac57700985d7f95 100644 (file)
@@ -137,7 +137,7 @@ public class VersionUtil
         }
         else
         {
-            return version.endsWith( SNAPSHOT );
+            return isGenericSnapshot(version);
         }
     }
 
index 58e1dd9cce52df003d212f223406ca07ddd0240f..6bc21386a8f0f8dc99d2a066c2e976743552972c 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.model.ArchivaArtifact;
+import org.apache.maven.archiva.model.ArchivaModelCloner;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.model.Keys;
 import org.apache.maven.archiva.model.RepositoryProblem;
@@ -41,7 +42,6 @@ import org.apache.maven.archiva.repository.RepositoryContentFactory;
 import org.apache.maven.archiva.repository.RepositoryException;
 import org.apache.maven.archiva.repository.content.ManagedLegacyRepositoryContent;
 import org.apache.maven.archiva.repository.project.ProjectModelException;
-import org.apache.maven.archiva.repository.project.ProjectModelFilter;
 import org.apache.maven.archiva.repository.project.ProjectModelReader;
 import org.apache.maven.archiva.repository.project.filters.EffectiveProjectModelFilter;
 import org.apache.maven.archiva.repository.project.readers.ProjectModel300Reader;
@@ -85,11 +85,6 @@ public class ProjectModelToDatabaseConsumer
      */
     private RepositoryContentFactory repositoryFactory;
 
-    /**
-     * @plexus.requirement role-hint="expression"
-     */
-    private ProjectModelFilter expressionModelFilter;
-
     /**
      * @plexus.requirement role="org.apache.maven.archiva.repository.project.ProjectModelFilter"
      * role-hint="effective"
@@ -160,23 +155,22 @@ public class ProjectModelToDatabaseConsumer
         {
             model = reader.read( artifactFile );
 
-            model.setOrigin( "filesystem" );
-
             // The version should be updated to the artifact/filename version if it is a unique snapshot
             if ( VersionUtil.isUniqueSnapshot( artifact.getVersion() ) )
             {
                 model.setVersion( artifact.getVersion() );
             }
 
-            // Filter the model
-            model = expressionModelFilter.filter( model );
-
-            // Resolve the project model
+            // Resolve the project model (build effective model, resolve expressions)
             model = effectiveModelFilter.filter( model );
 
             if ( isValidModel( model, repo, artifact ) )
             {
                 log.debug( "Adding project model to database - " + Keys.toKey( model ) );
+                
+                // Clone model, since DAO while detachingCopy resets its contents
+                // This changes contents of the cache in EffectiveProjectModelFilter
+                model = ArchivaModelCloner.clone( model );
                 dao.getProjectModelDAO().saveProjectModel( model );
             }
             else
@@ -356,5 +350,4 @@ public class ProjectModelToDatabaseConsumer
             }
         }
     }
-    
 }
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.java
new file mode 100644 (file)
index 0000000..955d221
--- /dev/null
@@ -0,0 +1,125 @@
+package org.apache.maven.archiva.consumers.database;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.consumers.ConsumerException;
+import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.ArchivaDatabaseException;
+import org.apache.maven.archiva.database.ObjectNotFoundException;
+import org.apache.maven.archiva.database.ProjectModelDAO;
+import org.apache.maven.archiva.model.ArchivaArtifact;
+import org.apache.maven.archiva.model.ArchivaArtifactModel;
+import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.Keys;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
+
+/**
+ * Test for ProjectModelToDatabaseConsumerTest
+ * 
+ * @author <a href="mailto:michal.stochmialek@eurobank.pl">Michal Stochmialek</a>
+ */
+public class ProjectModelToDatabaseConsumerTest
+    extends PlexusInSpringTestCase
+{
+    private ProjectModelToDatabaseConsumer consumer;
+
+    private ProjectModelDAO modelDao;
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        ArchivaConfiguration archivaConfig = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
+
+        Configuration configuration = archivaConfig.getConfiguration();
+        ManagedRepositoryConfiguration repo = configuration.findManagedRepositoryById( "internal" );
+        repo.setLocation( new File( getBasedir(), "src/test/resources/test-repo" ).toString() );
+
+        consumer =
+            (ProjectModelToDatabaseConsumer) lookup( DatabaseUnprocessedArtifactConsumer.class, "update-db-project" );
+        modelDao = (ProjectModelDAO) lookup( ProjectModelDAO.class, "jdo" );
+    }
+
+    public void testProcess()
+        throws Exception
+    {
+        ArchivaProjectModel model = processAndGetModel( "test-project", "test-project-endpoint-pom", "2.4.4" );
+        assertNotNull( model.getParentProject() );
+        assertEquals( "test-project:test-project:2.4.4", Keys.toKey( model.getParentProject() ) );
+
+        assertFalse( model.getDependencyManagement().isEmpty() );
+
+        model = processAndGetModel( "test-project", "test-project-endpoint-ejb", "2.4.4" );
+        assertNotNull( model.getParentProject() );
+        assertEquals( "test-project:test-project-endpoint-pom:2.4.4", Keys.toKey( model.getParentProject() ) );
+        assertTrue( hasDependency( model, "test-project:test-project-api:2.4.4" ) );
+        assertTrue( hasDependency( model, "commons-id:commons-id:0.1-dev" ) );
+
+        model = processAndGetModel( "test-project", "test-project", "2.4.4" );
+        assertFalse( model.getDependencyManagement().isEmpty() );
+    }
+
+    private boolean hasDependency( ArchivaProjectModel model, String key )
+    {
+        for ( Iterator i = model.getDependencies().iterator(); i.hasNext(); )
+        {
+            Dependency dependency = (Dependency) i.next();
+            if ( key.equals( Keys.toKey( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion() ) ) )
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private ArchivaProjectModel processAndGetModel( String group, String artifactId, String version )
+        throws ConsumerException, ObjectNotFoundException, ArchivaDatabaseException
+    {
+        ArchivaArtifact artifact = createArtifact( group, artifactId, version, "pom" );
+        consumer.processArchivaArtifact( artifact );
+
+        ArchivaProjectModel model = modelDao.getProjectModel( group, artifactId, version );
+        assertEquals( group, model.getGroupId() );
+        assertEquals( artifactId, model.getArtifactId() );
+        assertEquals( version, model.getVersion() );
+        return model;
+    }
+
+    protected ArchivaArtifact createArtifact( String group, String artifactId, String version, String type )
+    {
+        ArchivaArtifactModel model = new ArchivaArtifactModel();
+        model.setGroupId( group );
+        model.setArtifactId( artifactId );
+        model.setVersion( version );
+        model.setType( type );
+        model.setRepositoryId( "internal" );
+
+        return new ArchivaArtifact( model );
+    }
+
+}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.xml
new file mode 100644 (file)
index 0000000..3766646
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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.
+-->
+
+<component-set>
+    <components>
+        <!-- JdoAccess -->
+        <component>
+            <role>org.apache.maven.archiva.database.jdo.JdoAccess</role>
+            <role-hint>archiva</role-hint>
+            <implementation>org.apache.maven.archiva.database.jdo.JdoAccess</implementation>
+            <requirements>
+                <requirement>
+                    <role>org.codehaus.plexus.jdo.JdoFactory</role>
+                    <role-hint>archiva</role-hint>
+                </requirement>
+            </requirements>
+        </component>
+
+        <!-- JDO Factory -->
+        <component>
+            <role>org.codehaus.plexus.jdo.JdoFactory</role>
+            <role-hint>archiva</role-hint>
+            <implementation>org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory</implementation>
+
+            <configuration>
+                <!-- Database Configuration -->
+                <driverName>org.hsqldb.jdbcDriver</driverName>
+                <url>jdbc:hsqldb:mem:TESTDB</url>
+                <userName>sa</userName>
+                <password></password>
+
+                <!-- JPOX and JDO configuration -->
+                <persistenceManagerFactoryClass>org.jpox.PersistenceManagerFactoryImpl</persistenceManagerFactoryClass>
+                <otherProperties>
+                    <property>
+                        <name>javax.jdo.PersistenceManagerFactoryClass</name>
+                        <value>org.jpox.PersistenceManagerFactoryImpl</value>
+                    </property>
+                    <property>
+                        <name>org.jpox.autoCreateSchema</name>
+                        <value>true</value>
+                    </property>
+                </otherProperties>
+            </configuration>
+        </component>
+
+        <component>
+            <role>org.codehaus.plexus.cache.Cache</role>
+            <role-hint>effective-project-cache</role-hint>
+            <implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation>
+            <description>Effective Project Cache</description>
+            <configuration>
+                <disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds>
+                <disk-persistent>true</disk-persistent>
+                <disk-store-path>${java.io.tmpdir}/archiva/effectiveproject</disk-store-path>
+                <eternal>true</eternal>
+                <max-elements-in-memory>1000</max-elements-in-memory>
+                <memory-eviction-policy>LRU</memory-eviction-policy>
+                <name>effective-project-cache</name>
+                <overflow-to-disk>false</overflow-to-disk>
+                <!-- TODO: Adjust the time to live to be more sane (ie: huge 4+ hours) -->
+                <!-- 45 minutes = 2700 seconds -->
+                <time-to-idle-seconds>2700</time-to-idle-seconds>
+                <!-- 30 minutes = 1800 seconds  -->
+                <time-to-live-seconds>1800</time-to-live-seconds>
+            </configuration>
+        </component>
+    </components>
+</component-set>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom
new file mode 100644 (file)
index 0000000..fa0c87e
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-api</artifactId>
+    <name>Test Project API</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom
new file mode 100644 (file)
index 0000000..b333a52
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project-broker-pom</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-broker-ejb</artifactId>
+    <name>Test Project Broker EJB</name>
+    <packaging>ejb</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <type>test-jar</type>
+            <version>${pom.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-mock</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom
new file mode 100644 (file)
index 0000000..fd54736
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-broker-pom</artifactId>
+    <name>Test Project Broker POM</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>broker-ejb</module>
+    </modules>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom
new file mode 100644 (file)
index 0000000..d47958b
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-common</artifactId>
+    <name>Test Project Commons</name>
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.castor</groupId>
+            <artifactId>castor</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xerces</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.ejb</groupId>
+            <artifactId>ejb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+    </dependencies>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom
new file mode 100644 (file)
index 0000000..582f1e5
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project-endpoint-pom</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-endpoint-ejb</artifactId>
+    <name>Test Project Endpoint EJB</name>
+    <packaging>ejb</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <!-- for tests only -->
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom
new file mode 100644 (file)
index 0000000..ea4d637
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-endpoint-pom</artifactId>
+    <name>Test Project Endpoint POM</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>endpoint-ejb</module>
+    </modules>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project/2.4.4/test-project-2.4.4.pom b/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/test-project/test-project/2.4.4/test-project-2.4.4.pom
new file mode 100644 (file)
index 0000000..6dc4719
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>test-project</groupId>
+    <artifactId>test-project</artifactId>
+    <name>Test Project</name>
+    <version>2.4.4</version>
+    <packaging>pom</packaging>
+
+    <organization>
+        <name>Company</name>
+        <url>http://www.company.com/</url>
+    </organization>
+    <inceptionYear>2002</inceptionYear>
+
+    <modules>
+        <module>api</module>
+        <module>common</module>
+        <module>broker</module>
+        <module>endpoint</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <!-- common version strategy -->
+            <dependency>
+                <groupId>javax.activation</groupId>
+                <artifactId>activation</artifactId>
+                <version>1.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.jms</groupId>
+                <artifactId>jms</artifactId>
+                <version>1.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.ejb</groupId>
+                <artifactId>ejb</artifactId>
+                <version>2.0</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+                <version>2.4</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.mail</groupId>
+                <artifactId>mail</artifactId>
+                <version>1.4</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>xml-apis</groupId>
+                <artifactId>xml-apis</artifactId>
+                <version>2.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>commons-logging</groupId>
+                <artifactId>commons-logging</artifactId>
+                <version>1.0.4</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-lang</groupId>
+                <artifactId>commons-lang</artifactId>
+                <version>2.1</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-collections</groupId>
+                <artifactId>commons-collections</artifactId>
+                <version>3.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring</artifactId>
+                <version>2.0.7</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-mock</artifactId>
+                <version>2.0.7</version>
+                <scope>test</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring-jdbc</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring-web</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>log4j</groupId>
+                <artifactId>log4j</artifactId>
+                <version>1.2.8</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-discovery</groupId>
+                <artifactId>commons-discovery</artifactId>
+                <version>0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-id</groupId>
+                <artifactId>commons-id</artifactId>
+                <version>0.1-dev</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.castor</groupId>
+                <artifactId>castor</artifactId>
+                <version>1.0.5-xml</version>
+            </dependency>
+            <dependency>
+                <groupId>xerces</groupId>
+                <artifactId>xerces</artifactId>
+                <version>2.4.0</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-httpclient</groupId>
+                <artifactId>commons-httpclient</artifactId>
+                <version>3.1</version>
+            </dependency>
+            <dependency>
+                <groupId>stax</groupId>
+                <artifactId>stax-api</artifactId>
+                <version>1.0.1</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.woodstox</groupId>
+                <artifactId>wstx-asl</artifactId>
+                <version>3.2.1</version>
+            </dependency>
+            <dependency>
+                <groupId>com.thoughtworks.xstream</groupId>
+                <artifactId>xstream</artifactId>
+                <version>1.2.2</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.management</groupId>
+                <artifactId>jmxri</artifactId>
+                <version>1.2.1</version>
+                <scope>provided</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>
index b7e03b5af94727a68b232e8f178a027311369380..93912f68817ab94e19e2f9c962c7ddc1abc81868 100644 (file)
         StringBuffer key = new StringBuffer();
 
         key.append( defaultString( reference.getGroupId() ) ).append( ":" );
-        key.append( defaultString( reference.getArtifactId() ) ).append( ":" );
+        key.append( defaultString( reference.getArtifactId() ) );
 
         return key.toString();
     }
 
         key.append( defaultString( reference.getGroupId() ) ).append( ":" );
         key.append( defaultString( reference.getArtifactId() ) ).append( ":" );
-        key.append( defaultString( reference.getVersion() ) ).append( ":" );
+        key.append( defaultString( reference.getVersion() ) );
 
         return key.toString();
     }
index fa49e5d1403acac0f1102263a44be192c5883f72..08228a5e7bca4ec353c7049e49964d202e2759ed 100644 (file)
@@ -104,7 +104,8 @@ public class FilenameParser
 
             // check it starts with the same version up to the snapshot part
             int leadingLength = expected.length() - 9;
-            if ( version.startsWith( expected.substring( 0, leadingLength ) ) && version.length() > leadingLength )
+            if ( leadingLength > 0 && version.startsWith( expected.substring( 0, leadingLength ) ) &&
+                version.length() > leadingLength )
             {
                 // If we expect a non-generic snapshot - look for the timestamp
                 Matcher m = SNAPSHOT_PATTERN.matcher( version.substring( leadingLength + 1 ) );
index b14b52a04b88218c851b4923869e9d053a7e0c34..6470eaa564417ee9794654c86d19e9d7d8524120 100644 (file)
@@ -77,6 +77,7 @@ public class ProjectModelMerge
         ArchivaProjectModel merged = new ArchivaProjectModel();
 
         // Unmerged.
+        merged.setParentProject(mainProject.getParentProject());
         merged.setArtifactId( mainProject.getArtifactId() );
         merged.setPackaging( StringUtils.defaultIfEmpty( mainProject.getPackaging(), "jar" ) );
         merged.setRelocation( mainProject.getRelocation() );
@@ -334,6 +335,7 @@ public class ProjectModelMerge
         }
 
         Properties merged = new Properties();
+        merged.putAll(mainProperties);
 
         Enumeration keys = parentProperties.propertyNames();
         while ( keys.hasMoreElements() )
index 24a22f90c00667bf20a5fa1ace38677eb1cc560f..d1860e8c8e3a867a9d2a41839ed550dae85beb75 100644 (file)
@@ -100,20 +100,23 @@ public class EffectiveProjectModelFilter
         // Clone submitted project (so that we don't mess with it) 
         effectiveProject = ArchivaModelCloner.clone( project );
 
-        // Setup Expression Evaluation pieces.
-        effectiveProject = expressionFilter.filter( effectiveProject );
-
         DEBUG( "Starting build of effective with: " + effectiveProject );
 
         // Merge in all the parent poms.
         effectiveProject = mergeParent( effectiveProject );
 
+        // Setup Expression Evaluation pieces.
+        effectiveProject = expressionFilter.filter( effectiveProject );
+
         // Resolve dependency versions from dependency management.
         applyDependencyManagement( effectiveProject );
 
+        // groupId or version could be updated by parent or expressions
+        projectKey = toProjectKey( effectiveProject );
+        
         // Do not add project into cache if it contains no groupId and
         // version information
-        if ( project.getGroupId() != null && project.getVersion() != null )
+        if ( effectiveProject.getGroupId() != null && effectiveProject.getVersion() != null )
         {
             synchronized ( effectiveProjectCache )
             {
@@ -191,8 +194,8 @@ public class EffectiveProjectModelFilter
             if ( parentProject != null )
             {
                 // Merge the pom with the parent pom.
-                parentProject = expressionFilter.filter( parentProject );
                 parentProject = mergeParent( parentProject );
+                parentProject = expressionFilter.filter( parentProject );
 
                 // Cache the pre-merged parent.
                 synchronized ( effectiveProjectCache )
index 1c2f989ba4271cd2898ab5bc4d7143517d56f9db..6c39cd3e66a2e246940d7d666768abbecdf32728 100644 (file)
@@ -104,11 +104,24 @@ public class ProjectModelExpressionFilter
             try
             {
                 // Setup some common properties.
+                VersionedReference parent = model.getParentProject();
+                if ( parent != null )
+                {
+                    String parentGroupId = StringUtils.defaultString( evaluator.expand( parent.getGroupId() ) );
+                    String parentArtifactId = StringUtils.defaultString( evaluator.expand( parent.getArtifactId() ) );
+                    String parentVersion = StringUtils.defaultString( evaluator.expand( parent.getVersion() ) );
+
+                    props.setProperty( "parent.groupId", parentGroupId );
+                    props.setProperty( "parent.artifactId", parentArtifactId );
+                    props.setProperty( "parent.version", parentVersion );
+                }
+
                 String groupId = StringUtils.defaultString( evaluator.expand( model.getGroupId() ) );
                 String artifactId = StringUtils.defaultString( evaluator.expand( model.getArtifactId() ) );
                 String version = StringUtils.defaultString( evaluator.expand( model.getVersion() ) );
                 String name = StringUtils.defaultString( evaluator.expand( model.getName() ) );
                 
+
                 /* Archiva doesn't need to handle a full expression language with object tree walking
                  * as the requirements within Archiva are much smaller, a quick replacement of the
                  * important fields (groupId, artifactId, version, name) are handled specifically. 
index 95aa27c6c8a830e961b9c1adcc18317796d45c9d..a46d85f4c919bee347deca3e4473f8fbbee9def7 100644 (file)
@@ -94,6 +94,8 @@ public class ProjectModel300Reader
             model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) );
             model.setDependencies( getDependencies( xml ) );
             
+            model.setOrigin("filesystem");
+
             /* Following are not valid for <pomVersion>3</pomVersion> / Maven 1 pom files.
              * 
              * model.setDependencyManagement()
index 38509be26623b47e607a4c1c8ecbc65c5b603526..441f63f6fac8b89413bcb9c3d39a492b3eed132c 100644 (file)
@@ -104,6 +104,8 @@ public class ProjectModel400Reader
             model.setBuildExtensions( getBuildExtensions( xml ) );
 
             model.setRelocation( getRelocation( xml ) );
+            
+            model.setOrigin("filesystem");
 
             return model;
         }
index 9129a9db4c153248436ceb521cefa70e3edcf9a5..37d9d112c36160d848eb4031f8175f73c2ece20e 100644 (file)
       <artifactId>archiva-common</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-test-A</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-test-B</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/test-project-model-effective.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/test-project-model-effective.pom
new file mode 100644 (file)
index 0000000..3057af9
--- /dev/null
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!-- Generated by Maven Help Plugin on 9/17/08 5:36 PM                      -->
+<!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!-- Effective POM for project                                              -->
+<!-- 'test-project:test-project-endpoint-ejb:ejb:2.4.4'                     -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<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>test-project-endpoint-pom</artifactId>
+    <groupId>test-project</groupId>
+    <version>2.4.4</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>test-project</groupId>
+  <artifactId>test-project-endpoint-ejb</artifactId>
+  <packaging>ejb</packaging>
+  <name>Test Project Endpoint EJB</name>
+  <version>2.4.4</version>
+  <inceptionYear>2002</inceptionYear>
+  <organization>
+    <name>Company</name>
+    <url>http://www.company.com/</url>
+  </organization>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>test-project</groupId>
+      <artifactId>test-project-common</artifactId>
+      <version>2.4.4</version>
+    </dependency>
+    <dependency>
+      <groupId>test-project</groupId>
+      <artifactId>test-project-api</artifactId>
+      <version>2.4.4</version>
+    </dependency>
+    <dependency>
+      <groupId>test-project</groupId>
+      <artifactId>test-project-common</artifactId>
+      <version>2.4.4</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-id</groupId>
+      <artifactId>commons-id</artifactId>
+      <version>0.1-dev</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-discovery</groupId>
+      <artifactId>commons-discovery</artifactId>
+      <version>0.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.8</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.jms</groupId>
+      <artifactId>jms</artifactId>
+      <version>1.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.activation</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.mail</groupId>
+      <artifactId>mail</artifactId>
+      <version>1.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>xml-apis</groupId>
+      <artifactId>xml-apis</artifactId>
+      <version>2.0.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.management</groupId>
+      <artifactId>jmxri</artifactId>
+      <version>1.2.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>javax.activation</groupId>
+        <artifactId>activation</artifactId>
+        <version>1.0.2</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.jms</groupId>
+        <artifactId>jms</artifactId>
+        <version>1.0.2</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.ejb</groupId>
+        <artifactId>ejb</artifactId>
+        <version>2.0</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.servlet</groupId>
+        <artifactId>servlet-api</artifactId>
+        <version>2.4</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>javax.mail</groupId>
+        <artifactId>mail</artifactId>
+        <version>1.4</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>xml-apis</groupId>
+        <artifactId>xml-apis</artifactId>
+        <version>2.0.2</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>1.0.4</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-lang</groupId>
+        <artifactId>commons-lang</artifactId>
+        <version>2.1</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-collections</groupId>
+        <artifactId>commons-collections</artifactId>
+        <version>3.2</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring</artifactId>
+        <version>2.0.7</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-mock</artifactId>
+        <version>2.0.7</version>
+        <scope>test</scope>
+        <exclusions>
+          <exclusion>
+            <artifactId>spring-jdbc</artifactId>
+            <groupId>org.springframework</groupId>
+          </exclusion>
+          <exclusion>
+            <artifactId>spring-web</artifactId>
+            <groupId>org.springframework</groupId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>log4j</groupId>
+        <artifactId>log4j</artifactId>
+        <version>1.2.8</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-discovery</groupId>
+        <artifactId>commons-discovery</artifactId>
+        <version>0.2</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-id</groupId>
+        <artifactId>commons-id</artifactId>
+        <version>0.1-dev</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.castor</groupId>
+        <artifactId>castor</artifactId>
+        <version>1.0.5-xml</version>
+      </dependency>
+      <dependency>
+        <groupId>xerces</groupId>
+        <artifactId>xerces</artifactId>
+        <version>2.4.0</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-httpclient</groupId>
+        <artifactId>commons-httpclient</artifactId>
+        <version>3.1</version>
+      </dependency>
+      <dependency>
+        <groupId>stax</groupId>
+        <artifactId>stax-api</artifactId>
+        <version>1.0.1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.woodstox</groupId>
+        <artifactId>wstx-asl</artifactId>
+        <version>3.2.1</version>
+      </dependency>
+      <dependency>
+        <groupId>com.thoughtworks.xstream</groupId>
+        <artifactId>xstream</artifactId>
+        <version>1.2.2</version>
+      </dependency>
+      <dependency>
+        <groupId>javax.management</groupId>
+        <artifactId>jmxri</artifactId>
+        <version>1.2.1</version>
+        <scope>provided</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+</project>
\ No newline at end of file
index 6da1ce21e05be07eefb4f4da39d356344ca725c5..e1a0394feaedf79d643a4cc9fc74e274ffd4407b 100644 (file)
@@ -295,6 +295,15 @@ public class DefaultPathParserTest
         assertLayout( path, groupId, artifactId, version, classifier, type );
     }
 
+    /**
+     * A timestamped versioned artifact but without release version part. Like on axiom trunk. 
+     */
+    public void testBadSnapshotWithoutReleasePart()
+    {
+        assertBadPath( "org/apache/ws/commons/axiom/axiom/SNAPSHOT/axiom-20070912.093446-2.pom", 
+             "snapshot version without release part");
+    }
+
     /**
      * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory.
      * @throws LayoutException
index 9b31da6317935ead363a20647b1d95f903daddc8..7f8238462ee30045bf02d1fc63692140b12d2ca2 100644 (file)
@@ -169,6 +169,15 @@ public class FilenameParserTest
         assertNull( parser.expect( "2.0-SNAPSHOT" ) );
     }
 
+    public void testExpectWrongSnapshot2()
+    {
+        // tests parsing axiom snapshots without exceptions
+        FilenameParser parser = new FilenameParser( "axiom-20080221.062205-9.pom" );
+
+        assertEquals( "axiom", parser.nextNonVersion() );
+        assertNull( parser.expect( "SNAPSHOT" ) );
+    }
+
     public void testClassifier()
     {
         FilenameParser parser = new FilenameParser( "artifact-id-1.0-20070219.171202-34-test-sources.jar" );
index c4f04182b8ec614069f2726bcdcfbfe89df1ba83..c65a73772df0aa648fcab2ed5bee2a414b374ee4 100644 (file)
@@ -81,20 +81,29 @@ public class EffectiveProjectModelFilterTest
     public void testBuildEffectiveProject()
         throws Exception
     {
+        assertEffectiveProject(
+                "/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom",
+        "/archiva-model-effective.pom");
+        assertEffectiveProject(
+                "/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom",
+        "/test-project-model-effective.pom");
+    }
+
+    private void assertEffectiveProject(String pomFile, String effectivePomFile) throws Exception,
+            ProjectModelException {
         initTestResolverFactory();
         EffectiveProjectModelFilter filter = lookupEffective();
 
-        ArchivaProjectModel startModel = createArchivaProjectModel( DEFAULT_REPOSITORY
-            + "/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom" );
+        ArchivaProjectModel startModel = createArchivaProjectModel( DEFAULT_REPOSITORY + pomFile );
 
         ArchivaProjectModel effectiveModel = filter.filter( startModel );
 
-        ArchivaProjectModel expectedModel = createArchivaProjectModel( "src/test/expected-poms/"
-            + "/archiva-model-effective.pom" );
+        ArchivaProjectModel expectedModel = createArchivaProjectModel( "src/test/expected-poms/" + effectivePomFile);
 
         assertModel( expectedModel, effectiveModel );
     }
 
+
     /**
      * [MRM-510] In Repository Browse, the first unique snapshot version clicked is getting persisted in the 
      * request resulting to 'version does not match' error
@@ -272,7 +281,7 @@ public class EffectiveProjectModelFilterTest
         while ( it.hasNext() )
         {
             Dependency dep = it.next();
-            String key = Dependency.toVersionlessKey( dep );
+            String key = Dependency.toKey( dep );
             map.put( key, dep );
         }
         return map;
index 5d6d0c3b7815811946b19a1abf1dc6225a84b3ac..735bf9b3161d876b48041fd5a164dcee783da499 100644 (file)
@@ -92,6 +92,6 @@ public class ProjectModel400ReaderTest
         assertEquals( "Parent Version", "1.0-SNAPSHOT", parentRef.getVersion() );
         
         assertNotNull( "Dependencies", project.getDependencies() );
-        assertEquals( "Dependencies.size", 6, project.getDependencies().size() );
+        assertEquals( "Dependencies.size", 8, project.getDependencies().size() );
     }
 }
index 52c185ea706a5855acec976d039618057c7db7f9..9c9053a3c984acb140096013ac884563f4c6258d 100644 (file)
       <groupId>org.apache.maven.archiva</groupId>
       <artifactId>archiva-common</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-test-A</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.archiva</groupId>
+      <artifactId>archiva-test-B</artifactId>
+      <version>${parent.version}</version>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-api/2.4.4/test-project-api-2.4.4.pom
new file mode 100644 (file)
index 0000000..fa0c87e
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-api</artifactId>
+    <name>Test Project API</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-ejb/2.4.4/test-project-broker-ejb-2.4.4.pom
new file mode 100644 (file)
index 0000000..b333a52
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project-broker-pom</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-broker-ejb</artifactId>
+    <name>Test Project Broker EJB</name>
+    <packaging>ejb</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <type>test-jar</type>
+            <version>${pom.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-mock</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-broker-pom/2.4.4/test-project-broker-pom-2.4.4.pom
new file mode 100644 (file)
index 0000000..fd54736
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-broker-pom</artifactId>
+    <name>Test Project Broker POM</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>broker-ejb</module>
+    </modules>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-common/2.4.4/test-project-common-2.4.4.pom
new file mode 100644 (file)
index 0000000..d47958b
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-common</artifactId>
+    <name>Test Project Commons</name>
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.castor</groupId>
+            <artifactId>castor</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xerces</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.ejb</groupId>
+            <artifactId>ejb</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+    </dependencies>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-ejb/2.4.4/test-project-endpoint-ejb-2.4.4.pom
new file mode 100644 (file)
index 0000000..582f1e5
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project-endpoint-pom</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <groupId>test-project</groupId>
+    <artifactId>test-project-endpoint-ejb</artifactId>
+    <name>Test Project Endpoint EJB</name>
+    <packaging>ejb</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>test-project</groupId>
+            <artifactId>test-project-api</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <!-- for tests only -->
+            <groupId>test-project</groupId>
+            <artifactId>test-project-common</artifactId>
+            <version>${pom.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-id</groupId>
+            <artifactId>commons-id</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>activation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.mail</groupId>
+            <artifactId>mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.management</groupId>
+            <artifactId>jmxri</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project-endpoint-pom/2.4.4/test-project-endpoint-pom-2.4.4.pom
new file mode 100644 (file)
index 0000000..ea4d637
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>test-project</groupId>
+        <artifactId>test-project</artifactId>
+        <version>2.4.4</version>
+    </parent>
+    <artifactId>test-project-endpoint-pom</artifactId>
+    <name>Test Project Endpoint POM</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>endpoint-ejb</module>
+    </modules>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project/2.4.4/test-project-2.4.4.pom b/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/test-project/test-project/2.4.4/test-project-2.4.4.pom
new file mode 100644 (file)
index 0000000..6dc4719
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>test-project</groupId>
+    <artifactId>test-project</artifactId>
+    <name>Test Project</name>
+    <version>2.4.4</version>
+    <packaging>pom</packaging>
+
+    <organization>
+        <name>Company</name>
+        <url>http://www.company.com/</url>
+    </organization>
+    <inceptionYear>2002</inceptionYear>
+
+    <modules>
+        <module>api</module>
+        <module>common</module>
+        <module>broker</module>
+        <module>endpoint</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <!-- common version strategy -->
+            <dependency>
+                <groupId>javax.activation</groupId>
+                <artifactId>activation</artifactId>
+                <version>1.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.jms</groupId>
+                <artifactId>jms</artifactId>
+                <version>1.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.ejb</groupId>
+                <artifactId>ejb</artifactId>
+                <version>2.0</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.servlet</groupId>
+                <artifactId>servlet-api</artifactId>
+                <version>2.4</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.mail</groupId>
+                <artifactId>mail</artifactId>
+                <version>1.4</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>xml-apis</groupId>
+                <artifactId>xml-apis</artifactId>
+                <version>2.0.2</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>commons-logging</groupId>
+                <artifactId>commons-logging</artifactId>
+                <version>1.0.4</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-lang</groupId>
+                <artifactId>commons-lang</artifactId>
+                <version>2.1</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-collections</groupId>
+                <artifactId>commons-collections</artifactId>
+                <version>3.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring</artifactId>
+                <version>2.0.7</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-mock</artifactId>
+                <version>2.0.7</version>
+                <scope>test</scope>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring-jdbc</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring-web</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>log4j</groupId>
+                <artifactId>log4j</artifactId>
+                <version>1.2.8</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-discovery</groupId>
+                <artifactId>commons-discovery</artifactId>
+                <version>0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-id</groupId>
+                <artifactId>commons-id</artifactId>
+                <version>0.1-dev</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.castor</groupId>
+                <artifactId>castor</artifactId>
+                <version>1.0.5-xml</version>
+            </dependency>
+            <dependency>
+                <groupId>xerces</groupId>
+                <artifactId>xerces</artifactId>
+                <version>2.4.0</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-httpclient</groupId>
+                <artifactId>commons-httpclient</artifactId>
+                <version>3.1</version>
+            </dependency>
+            <dependency>
+                <groupId>stax</groupId>
+                <artifactId>stax-api</artifactId>
+                <version>1.0.1</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.woodstox</groupId>
+                <artifactId>wstx-asl</artifactId>
+                <version>3.2.1</version>
+            </dependency>
+            <dependency>
+                <groupId>com.thoughtworks.xstream</groupId>
+                <artifactId>xstream</artifactId>
+                <version>1.2.2</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.management</groupId>
+                <artifactId>jmxri</artifactId>
+                <version>1.2.1</version>
+                <scope>provided</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>
index 04f3a23c70d99ef99562142b45287f9f3a07a67c..2e636197e2679f16e448e2592d1bb91c1ec75629 100644 (file)
@@ -24,6 +24,7 @@ import java.util.List;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
+import org.apache.maven.archiva.model.ArchivaModelCloner;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.repository.project.ProjectModelException;
@@ -135,7 +136,9 @@ public class ProjectModelToDatabaseListener
             return;
         }
 
-        model.setOrigin( "filesystem" );
+        // Clone model, since DAO while detachingCopy resets contents of the model
+        // this changes behaviour of EffectiveProjectModelFilter
+        model = ArchivaModelCloner.clone( model );
 
         try
         {