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
{
private List<KnownRepositoryContentConsumer> selectedKnownConsumers;
private List<InvalidRepositoryContentConsumer> selectedInvalidConsumers;
-
+
public RepositoryContentConsumers( ArchivaConfiguration archivaConfiguration )
{
this.archivaConfiguration = archivaConfiguration;
*
* @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
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 );
// invalidConsumer.completeScan();
invalidControl.replay();
- consumers.executeConsumers( repo, testFile );
+ consumers.executeConsumers( repo, testFile, true );
knownControl.verify();
invalidControl.verify();
// invalidConsumer.completeScan();
invalidControl.replay();
- consumers.executeConsumers( repo, notIncludedTestFile );
+ consumers.executeConsumers( repo, notIncludedTestFile, true );
knownControl.verify();
invalidControl.verify();
// 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.
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
{
File resourceFile;
+ boolean updateRelatedArtifacts;
+
public String getRepositoryId()
{
return repositoryId;
{
this.resourceFile = resourceFile;
}
+
+ public boolean isUpdateRelatedArtifacts()
+ {
+ return updateRelatedArtifacts;
+ }
+
+ public void setUpdateRelatedArtifacts( boolean updateRelatedArtifacts )
+ {
+ this.updateRelatedArtifacts = updateRelatedArtifacts;
+ }
}
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;
}
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
{
triggerAuditEvent( resource, AuditEvent.CREATE_DIR );
}
else
- {
+ {
throw new DavException( HttpServletResponse.SC_BAD_REQUEST, "Could not write member " +
resource.getResourcePath() + " at " + getResourcePath() );
}
}
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
{