archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r798403 - in /archiva/trunk/archiva-modules: archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/ archiva-base/archiva-repo...
Date Tue, 28 Jul 2009 05:04:44 GMT
Author: oching
Date: Tue Jul 28 05:04:44 2009
New Revision: 798403

URL: http://svn.apache.org/viewvc?rev=798403&view=rev
Log:
[MRM-1212]/[MRM-1197] do not execute create-missing-checksum and metadata-updater consumers
during webdav deployment

Modified:
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java
    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java
    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
Tue Jul 28 05:04:44 2009
@@ -585,7 +585,7 @@
     
     private void queueRepositoryTask( String repositoryId, File localFile )
     {
-        RepositoryTask task = TaskCreator.createRepositoryTask( repositoryId, localFile.getName(),
localFile );
+        RepositoryTask task = TaskCreator.createRepositoryTask( repositoryId, localFile.getName(),
localFile, true );
         
         try
         {

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java
Tue Jul 28 05:04:44 2009
@@ -58,7 +58,7 @@
     private List<KnownRepositoryContentConsumer> selectedKnownConsumers;
 
     private List<InvalidRepositoryContentConsumer> selectedInvalidConsumers;
-
+    
     public RepositoryContentConsumers( ArchivaConfiguration archivaConfiguration )
     {
         this.archivaConfiguration = archivaConfiguration;      
@@ -229,8 +229,9 @@
      * 
      * @param repository the repository configuration to use.
      * @param localFile the local file to execute the consumers against.
+     * @param updateRelatedArtifacts TODO
      */
-    public void executeConsumers( ManagedRepositoryConfiguration repository, File localFile
)
+    public void executeConsumers( ManagedRepositoryConfiguration repository, File localFile,
boolean updateRelatedArtifacts )
     {
         // Run the repository consumers
         try
@@ -238,6 +239,24 @@
             Closure triggerBeginScan = new TriggerBeginScanClosure( repository, getStartTime()
);
 
             List<KnownRepositoryContentConsumer> selectedKnownConsumers = getSelectedKnownConsumers();
+            
+            // MRM-1212/MRM-1197 
+            // - do not create missing/fix invalid checksums and update metadata when deploying
from webdav since these are uploaded by maven          
+            if( updateRelatedArtifacts == false )
+            {  
+                List<KnownRepositoryContentConsumer> clone = new ArrayList<KnownRepositoryContentConsumer>();
+                clone.addAll( selectedKnownConsumers );
+                
+                for( KnownRepositoryContentConsumer consumer : clone )
+                {
+                    if( consumer.getId().equals( "create-missing-checksums" ) || 
+                                    consumer.getId().equals( "metadata-updater" ) )
+                    {
+                        selectedKnownConsumers.remove( consumer );
+                    }
+                }               
+            }
+            
             List<InvalidRepositoryContentConsumer> selectedInvalidConsumers = getSelectedInvalidConsumers();
             CollectionUtils.forAllDo( selectedKnownConsumers, triggerBeginScan );
             CollectionUtils.forAllDo( selectedInvalidConsumers, triggerBeginScan );

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java
Tue Jul 28 05:04:44 2009
@@ -254,7 +254,7 @@
         //        invalidConsumer.completeScan();
         invalidControl.replay();
 
-        consumers.executeConsumers( repo, testFile );
+        consumers.executeConsumers( repo, testFile, true );
 
         knownControl.verify();
         invalidControl.verify();
@@ -279,7 +279,7 @@
         //        invalidConsumer.completeScan();
         invalidControl.replay();
 
-        consumers.executeConsumers( repo, notIncludedTestFile );
+        consumers.executeConsumers( repo, notIncludedTestFile, true );
 
         knownControl.verify();
         invalidControl.verify();
@@ -302,12 +302,12 @@
         //        invalidConsumer.completeScan();
         invalidControl.replay();
 
-        consumers.executeConsumers( repo, excludedTestFile );
+        consumers.executeConsumers( repo, excludedTestFile, true );
 
         knownControl.verify();
         invalidControl.verify();
     }
-
+    
     /**
      * Create an OS specific version of the filepath.
      * Provide path in unix "/" format.

Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
(original)
+++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
Tue Jul 28 05:04:44 2009
@@ -113,7 +113,7 @@
         if( repoTask.getResourceFile() != null )
         {
             log.debug( "Executing task from queue with job name: " + repoTask.getName() );
-            consumers.executeConsumers( arepo, repoTask.getResourceFile() );
+            consumers.executeConsumers( arepo, repoTask.getResourceFile(), repoTask.isUpdateRelatedArtifacts()
);
         }
         else
         {

Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java
(original)
+++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java
Tue Jul 28 05:04:44 2009
@@ -40,6 +40,8 @@
     
     File resourceFile;
     
+    boolean updateRelatedArtifacts;
+    
     public String getRepositoryId()
     {
         return repositoryId;
@@ -89,4 +91,14 @@
     {
         this.resourceFile = resourceFile;
     }
+
+    public boolean isUpdateRelatedArtifacts()
+    {
+        return updateRelatedArtifacts;
+    }
+
+    public void setUpdateRelatedArtifacts( boolean updateRelatedArtifacts )
+    {
+        this.updateRelatedArtifacts = updateRelatedArtifacts;
+    }
 }

Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java
(original)
+++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java
Tue Jul 28 05:04:44 2009
@@ -47,11 +47,13 @@
         return task;
     }
         
-    public static RepositoryTask createRepositoryTask( String repositoryId, String taskNameSuffix,
File resourceFile )
+    public static RepositoryTask createRepositoryTask( String repositoryId, String taskNameSuffix,
File resourceFile,
+                                                       boolean updateRelatedArtifacts )
     {
         RepositoryTask task = createRepositoryTask( repositoryId, taskNameSuffix );
         task.setResourceFile( resourceFile );
-        
+        task.setUpdateRelatedArtifacts( updateRelatedArtifacts );
+
         return task;
     }
     

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
Tue Jul 28 05:04:44 2009
@@ -617,7 +617,7 @@
 
     private void queueRepositoryTask( String repositoryId, File localFile )
     {
-        RepositoryTask task = TaskCreator.createRepositoryTask( repositoryId, localFile.getName(),
localFile );
+        RepositoryTask task = TaskCreator.createRepositoryTask( repositoryId, localFile.getName(),
localFile, true );
 
         try
         {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java?rev=798403&r1=798402&r2=798403&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
Tue Jul 28 05:04:44 2009
@@ -322,7 +322,7 @@
             triggerAuditEvent( resource, AuditEvent.CREATE_DIR );
         }
         else
-        {
+        {            
             throw new DavException( HttpServletResponse.SC_BAD_REQUEST, "Could not write
member " +
                 resource.getResourcePath() + " at " + getResourcePath() );
         }
@@ -632,8 +632,8 @@
     }
     
     private void queueRepositoryTask(  File localFile )
-    {
-        RepositoryTask task = TaskCreator.createRepositoryTask( repository.getId(), localFile.getName(),
localFile );
+    {        
+        RepositoryTask task = TaskCreator.createRepositoryTask( repository.getId(), localFile.getName(),
localFile, false );
         
         try
         {



Mime
View raw message