]> source.dussan.org Git - archiva.git/commitdiff
set repository id in ArtifactUpdateDatabaseConsumer only when repository id is null
authorMaria Odea B. Ching <oching@apache.org>
Tue, 24 Feb 2009 08:35:43 +0000 (08:35 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Tue, 24 Feb 2009 08:35:43 +0000 (08:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@747306 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java

index 864ef8a63eafefb1e53fac7077bc8af85b06ce13..db22000062e234febc850e258dd8bc12b6acd74e 100644 (file)
@@ -57,7 +57,7 @@ import java.util.List;
 public class ArtifactUpdateDatabaseConsumer
     extends AbstractMonitoredConsumer
     implements KnownRepositoryContentConsumer, RegistryListener, Initializable
-{
+{                                                                  
     private static final String TYPE_NOT_ARTIFACT = "file-not-artifact";
 
     private static final String DB_ERROR = "db-error";
@@ -161,10 +161,13 @@ public class ArtifactUpdateDatabaseConsumer
         {
             return;
         }
-
+        
         try
         {
-            artifact.getModel().setRepositoryId( this.repository.getId() );
+            if( artifact.getModel().getRepositoryId() == null )
+            {
+                artifact.getModel().setRepositoryId( this.repository.getId() );
+            }
 
             // Calculate the hashcodes.
             File artifactFile = new File( this.repositoryDir, path );