diff options
author | Maria Odea B. Ching <oching@apache.org> | 2009-07-28 05:04:44 +0000 |
---|---|---|
committer | Maria Odea B. Ching <oching@apache.org> | 2009-07-28 05:04:44 +0000 |
commit | 5e5fa749a240662560a74a983e2f6eae3fed9ff9 (patch) | |
tree | 06512eea4bfbbc8c70404d21669b9f2d94c4ee5f /archiva-modules/archiva-base/archiva-repository-layer | |
parent | 8053590db664b766c98f37467b78558647376f7a (diff) | |
download | archiva-5e5fa749a240662560a74a983e2f6eae3fed9ff9.tar.gz archiva-5e5fa749a240662560a74a983e2f6eae3fed9ff9.zip |
[MRM-1212]/[MRM-1197] do not execute create-missing-checksum and metadata-updater consumers during webdav deployment
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@798403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-layer')
2 files changed, 25 insertions, 6 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java index e8e4ee521..ec54b041e 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java @@ -58,7 +58,7 @@ public class RepositoryContentConsumers private List<KnownRepositoryContentConsumer> selectedKnownConsumers; private List<InvalidRepositoryContentConsumer> selectedInvalidConsumers; - + public RepositoryContentConsumers( ArchivaConfiguration archivaConfiguration ) { this.archivaConfiguration = archivaConfiguration; @@ -229,8 +229,9 @@ public class RepositoryContentConsumers * * @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 @@ public class RepositoryContentConsumers 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 ); diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java index 5906c7641..86c4b5370 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -254,7 +254,7 @@ public class RepositoryContentConsumersTest // invalidConsumer.completeScan(); invalidControl.replay(); - consumers.executeConsumers( repo, testFile ); + consumers.executeConsumers( repo, testFile, true ); knownControl.verify(); invalidControl.verify(); @@ -279,7 +279,7 @@ public class RepositoryContentConsumersTest // invalidConsumer.completeScan(); invalidControl.replay(); - consumers.executeConsumers( repo, notIncludedTestFile ); + consumers.executeConsumers( repo, notIncludedTestFile, true ); knownControl.verify(); invalidControl.verify(); @@ -302,12 +302,12 @@ public class RepositoryContentConsumersTest // 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. |