aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-applet/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-rss/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-security/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-test/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/pom.xml8
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java14
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java60
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java7
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp56
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/database/DatabaseActionTest.java53
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/pom.xml6
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java1
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java2
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java25
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java36
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java32
-rw-r--r--archiva-modules/archiva-web/archiva-xmlrpc/pom.xml2
-rw-r--r--archiva-modules/archiva-web/pom.xml2
24 files changed, 78 insertions, 252 deletions
diff --git a/archiva-modules/archiva-web/archiva-applet/pom.xml b/archiva-modules/archiva-web/archiva-applet/pom.xml
index 402ae2208..af8cc7de2 100644
--- a/archiva-modules/archiva-web/archiva-applet/pom.xml
+++ b/archiva-modules/archiva-web/archiva-applet/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-applet</artifactId>
<name>Archiva Web :: Applet</name>
diff --git a/archiva-modules/archiva-web/archiva-rss/pom.xml b/archiva-modules/archiva-web/archiva-rss/pom.xml
index 5f4df508f..95633e203 100644
--- a/archiva-modules/archiva-web/archiva-rss/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rss/pom.xml
@@ -22,7 +22,7 @@
<parent>
<artifactId>archiva-web</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-rss</artifactId>
diff --git a/archiva-modules/archiva-web/archiva-security/pom.xml b/archiva-modules/archiva-web/archiva-security/pom.xml
index 109016582..7ad99695f 100644
--- a/archiva-modules/archiva-web/archiva-security/pom.xml
+++ b/archiva-modules/archiva-web/archiva-security/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-security</artifactId>
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
index 93bdef4d5..774a3aea2 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-webapp-test</artifactId>
<packaging>pom</packaging>
diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml
index 6477f4fef..44e4b143e 100644
--- a/archiva-modules/archiva-web/archiva-webapp/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-webapp</artifactId>
<packaging>war</packaging>
@@ -71,6 +71,12 @@
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-metadata-consumer</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-lucene-consumers</artifactId>
</dependency>
<dependency>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java
index 7d2d62b25..e70e9d29d 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java
@@ -29,6 +29,8 @@ import java.util.Date;
import java.util.List;
import java.util.TimeZone;
+import com.opensymphony.xwork2.Preparable;
+import com.opensymphony.xwork2.Validateable;
import org.apache.archiva.checksum.ChecksumAlgorithm;
import org.apache.archiva.checksum.ChecksummedFile;
import org.apache.maven.archiva.common.utils.VersionComparator;
@@ -49,6 +51,7 @@ import org.apache.maven.archiva.repository.RepositoryException;
import org.apache.maven.archiva.repository.RepositoryNotFoundException;
import org.apache.maven.archiva.repository.audit.AuditEvent;
import org.apache.maven.archiva.repository.audit.Auditable;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
import org.apache.maven.archiva.repository.metadata.MetadataTools;
import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader;
@@ -58,9 +61,6 @@ import org.apache.maven.archiva.security.ArchivaSecurityException;
import org.apache.maven.archiva.security.PrincipalNotFoundException;
import org.apache.maven.archiva.security.UserRepositories;
-import com.opensymphony.xwork2.Preparable;
-import com.opensymphony.xwork2.Validateable;
-
/**
* Delete an artifact. Metadata will be updated if one exists, otherwise it would be created.
*
@@ -120,6 +120,9 @@ public class DeleteArtifactAction
*/
private DatabaseConsumers databaseConsumers;
+ /** @plexus.requirement */
+ private List<RepositoryListener> listeners;
+
private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[] { ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 };
public String getGroupId()
@@ -242,7 +245,10 @@ public class DeleteArtifactAction
{
if ( artifact.getVersion().equals( version ) )
{
- databaseConsumers.executeCleanupConsumer( artifact );
+ for ( RepositoryListener listener : listeners )
+ {
+ listener.deleteArtifact( repository, artifact );
+ }
}
}
}
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
index 7515fc2aa..58df2bbb3 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
@@ -22,6 +22,7 @@ package org.apache.maven.archiva.web.action.admin.database;
import java.util.Collections;
import java.util.List;
+import com.opensymphony.xwork2.Preparable;
import org.apache.commons.collections.CollectionUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
@@ -38,8 +39,6 @@ import org.codehaus.redback.integration.interceptor.SecureAction;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
import org.codehaus.redback.integration.interceptor.SecureActionException;
-import com.opensymphony.xwork2.Preparable;
-
/**
* DatabaseAction
*
@@ -72,16 +71,6 @@ public class DatabaseAction
*/
private List<String> enabledUnprocessedConsumers;
- /**
- * List of {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts.
- */
- private List<AdminDatabaseConsumer> cleanupConsumers;
-
- /**
- * List of enabled {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts.
- */
- private List<String> enabledCleanupConsumers;
-
public void prepare()
throws Exception
{
@@ -96,11 +85,6 @@ public class DatabaseAction
CollectionUtils.forAllDo( databaseConsumers.getAvailableUnprocessedConsumers(), addAdminDbConsumer );
this.unprocessedConsumers = addAdminDbConsumer.getList();
Collections.sort( this.unprocessedConsumers, AdminDatabaseConsumerComparator.getInstance() );
-
- addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getCleanupConsumers() );
- CollectionUtils.forAllDo( databaseConsumers.getAvailableCleanupConsumers(), addAdminDbConsumer );
- this.cleanupConsumers = addAdminDbConsumer.getList();
- Collections.sort( this.cleanupConsumers, AdminDatabaseConsumerComparator.getInstance() );
}
public String updateUnprocessedConsumers()
@@ -123,25 +107,6 @@ public class DatabaseAction
return saveConfiguration();
}
- public String updateCleanupConsumers()
- {
- List<String> oldConsumers = archivaConfiguration.getConfiguration().getDatabaseScanning().getCleanupConsumers();
-
- archivaConfiguration.getConfiguration().getDatabaseScanning().setCleanupConsumers( enabledCleanupConsumers );
-
- if ( enabledCleanupConsumers != null )
- {
- filterAddedConsumers( oldConsumers, enabledCleanupConsumers );
- filterRemovedConsumers( oldConsumers, enabledCleanupConsumers );
- }
- else
- {
- disableAllEnabledConsumers( oldConsumers );
- }
-
- return saveConfiguration();
- }
-
public String updateSchedule()
{
String oldCron = archivaConfiguration.getConfiguration().getDatabaseScanning().getCronExpression();
@@ -199,12 +164,7 @@ public class DatabaseAction
this.cron = cron;
}
- public List<AdminDatabaseConsumer> getCleanupConsumers()
- {
- return cleanupConsumers;
- }
-
- public List<AdminDatabaseConsumer> getUnprocessedConsumers()
+ public List getUnprocessedConsumers()
{
return unprocessedConsumers;
}
@@ -219,16 +179,6 @@ public class DatabaseAction
this.enabledUnprocessedConsumers = enabledUnprocessedConsumers;
}
- public List<String> getEnabledCleanupConsumers()
- {
- return enabledCleanupConsumers;
- }
-
- public void setEnabledCleanupConsumers( List<String> enabledCleanupConsumers )
- {
- this.enabledCleanupConsumers = enabledCleanupConsumers;
- }
-
public ArchivaConfiguration getArchivaConfiguration()
{
return archivaConfiguration;
@@ -238,7 +188,7 @@ public class DatabaseAction
{
this.archivaConfiguration = archivaConfiguration;
}
-
+
private void filterAddedConsumers( List<String> oldList, List<String> newList )
{
for ( String consumer : newList )
@@ -249,7 +199,7 @@ public class DatabaseAction
}
}
}
-
+
private void filterRemovedConsumers( List<String> oldList, List<String> newList )
{
for ( String consumer : oldList )
@@ -260,7 +210,7 @@ public class DatabaseAction
}
}
}
-
+
private void disableAllEnabledConsumers( List<String> enabledConsumers )
{
for( String consumer : enabledConsumers )
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
index 38a7df399..3f465c90a 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
@@ -24,6 +24,9 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import com.opensymphony.xwork2.Preparable;
+import com.opensymphony.xwork2.Validateable;
+import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -35,7 +38,6 @@ import org.apache.maven.archiva.configuration.functors.FiletypeSelectionPredicat
import org.apache.maven.archiva.configuration.functors.FiletypeToMapClosure;
import org.apache.maven.archiva.repository.audit.AuditEvent;
import org.apache.maven.archiva.repository.audit.Auditable;
-import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.maven.archiva.security.ArchivaRoleConstants;
import org.apache.maven.archiva.web.action.PlexusActionSupport;
import org.codehaus.plexus.redback.rbac.Resource;
@@ -44,9 +46,6 @@ import org.codehaus.redback.integration.interceptor.SecureAction;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
import org.codehaus.redback.integration.interceptor.SecureActionException;
-import com.opensymphony.xwork2.Preparable;
-import com.opensymphony.xwork2.Validateable;
-
/**
* RepositoryScanningAction
*
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp
index 71e0b0272..59324ff4b 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp
@@ -116,62 +116,6 @@
</c:otherwise>
</c:choose>
-<h2>Database - Artifact Cleanup Scanning</h2>
-
-<c:choose>
- <c:when test="${empty (cleanupConsumers)}">
- <%-- No Consumers. Eeek! --%>
- <strong>There are no consumers for artifact cleanup.</strong>
- </c:when>
- <c:otherwise>
- <%-- Display the consumers. --%>
-
- <s:form method="post" action="database!updateCleanupConsumers"
- namespace="/admin" validate="false" theme="simple">
- <table class="consumers">
- <tr>
- <th>&nbsp;</th>
- <th>Enabled?</th>
- <th>ID</th>
- <th>Description</th>
- </tr>
- <c:forEach items="${cleanupConsumers}" var="consumer" varStatus="i">
- <c:choose>
- <c:when test='${(i.index)%2 eq 0}'>
- <c:set var="bgcolor" value="even" scope="page" />
- </c:when>
- <c:otherwise>
- <c:set var="bgcolor" value="odd" scope="page" />
- </c:otherwise>
- </c:choose>
-
- <tr>
- <td class="${bgcolor}">
- <input type="checkbox" name="enabledCleanupConsumers" theme="simple" value="${consumer.id}" <c:if test="${consumer.enabled}">checked</c:if> />
- </td>
- <td class="${bgcolor}">
- <c:if test="${consumer.enabled}">
- <strong>enabled</strong>
- </c:if>
- </td>
- <td class="${bgcolor}">
- <code>${consumer.id}</code>
- </td>
- <td class="${bgcolor}">${consumer.description}</td>
- </tr>
- </c:forEach>
- <tr>
- <td colspan="4">
- <s:submit value="Update Consumers" />
- </td>
- </tr>
- </table>
- </s:form>
-
- </c:otherwise>
-</c:choose>
-
-
</div>
</div>
</body>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/database/DatabaseActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/database/DatabaseActionTest.java
index a47535ea5..361c1dd4b 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/database/DatabaseActionTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/database/DatabaseActionTest.java
@@ -72,7 +72,6 @@ public class DatabaseActionTest
config.setDatabaseScanning( databaseScanningConfig );
setUpEnabledUnproccessedConsumers();
- setUpEnabledCleanupConsumers();
action.setArchivaConfiguration( archivaConfig );
}
@@ -101,24 +100,6 @@ public class DatabaseActionTest
assertEquals( 3, results.size() );
}
- public void testUpdateCleanUpConsumers()
- throws Exception
- {
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
-
- archivaConfig.save( config );
- archivaConfigControl.replay();
-
- String returnString = action.updateCleanupConsumers();
-
- List<String> results = config.getDatabaseScanning().getCleanupConsumers();
-
- assertEquals( action.SUCCESS, returnString );
- assertEquals( 3, results.size() );
- }
-
public void testDisableAllUnprocessedConsumers( )
throws Exception
{
@@ -139,26 +120,6 @@ public class DatabaseActionTest
assertEquals( 0, results.size() );
}
- public void testDisableAllCleanupConsumers( )
- throws Exception
- {
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
- archivaConfigControl.expectAndReturn( archivaConfig.getConfiguration(), config );
-
- archivaConfig.save( config );
- archivaConfigControl.replay();
-
- action.setEnabledCleanupConsumers( null );
-
- String returnString = action.updateCleanupConsumers();
-
- List<String> results = config.getDatabaseScanning().getCleanupConsumers();
-
- assertEquals( action.SUCCESS, returnString );
- assertEquals( 0, results.size() );
- }
-
private void setUpEnabledUnproccessedConsumers( )
{
List<String> enabledUnprocessedConsumer = new ArrayList<String>();
@@ -168,17 +129,5 @@ public class DatabaseActionTest
enabledUnprocessedConsumer.add( "validate-repository-metadata" );
action.setEnabledUnprocessedConsumers( enabledUnprocessedConsumer );
- }
-
- private void setUpEnabledCleanupConsumers( )
- {
- List<String> enabledCleanupConsumers = new ArrayList<String>();
-
- enabledCleanupConsumers.add( "not-present-remove-db-artifact" );
- enabledCleanupConsumers.add( "not-present-remove-db-project" );
- enabledCleanupConsumers.add( "not-present-remove-indexed" );
-
- action.setEnabledCleanupConsumers( enabledCleanupConsumers );
- }
-
+ }
}
diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml
index 743f14045..2a963b1e6 100644
--- a/archiva-modules/archiva-web/archiva-webdav/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-webdav</artifactId>
@@ -36,6 +36,10 @@
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-scanner</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-repository-layer</artifactId>
</dependency>
<dependency>
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
index e020d7f4a..89c271238 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
@@ -25,7 +25,6 @@ import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java
index 937907585..8b656d8ec 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java
@@ -38,11 +38,9 @@ import org.apache.jackrabbit.webdav.lock.SimpleLockManager;
import org.apache.jackrabbit.webdav.lock.Type;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.repository.audit.AuditListener;
-import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.maven.archiva.webdav.util.MimeTypes;
import org.codehaus.plexus.spring.PlexusInSpringTestCase;
import org.codehaus.plexus.spring.PlexusToSpringUtils;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
public class DavResourceTest
extends PlexusInSpringTestCase
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java
index 573895c58..2105b3b45 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java
@@ -1,11 +1,30 @@
package org.apache.maven.archiva.webdav;
-import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
-import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
+/*
+ * 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.util.List;
+
+import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
+import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
public class StubRepositoryContentConsumers
extends RepositoryContentConsumers
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
index bd9196bdf..a370ddb5f 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
@@ -131,6 +131,10 @@
<field-name>httpAuth</field-name>
</requirement>
<requirement>
+ <role>org.apache.archiva.repository.scanner.RepositoryContentConsumers</role>
+ <role-hint>default</role-hint>
+ </requirement>
+ <requirement>
<role>org.codehaus.plexus.digest.ChecksumFile</role>
<field-name>checksum</field-name>
</requirement>
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml
index 74a63e922..71c3c0f41 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml
@@ -143,6 +143,10 @@
<field-name>httpAuth</field-name>
</requirement>
<requirement>
+ <role>org.apache.archiva.repository.scanner.RepositoryContentConsumers</role>
+ <role-hint>default</role-hint>
+ </requirement>
+ <requirement>
<role>org.codehaus.plexus.digest.ChecksumFile</role>
<field-name>checksum</field-name>
</requirement>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml
index 3a2f625ba..8a190a1e2 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-api/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-xmlrpc</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-xmlrpc-api</artifactId>
<name>Archiva Web :: XML-RPC API</name>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
index 98723d9ed..492d5b8d4 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-client/pom.xml
@@ -19,7 +19,7 @@
<parent>
<artifactId>archiva-xmlrpc</artifactId>
<groupId>org.apache.archiva</groupId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archiva-xmlrpc-client</artifactId>
@@ -63,7 +63,7 @@
<mainClass>org.apache.archiva.web.xmlrpc.client.SampleClient</mainClass>
<arguments>
<!--
- URL: ex. http://127.0.0.1:8080/archiva/xmlrpc
+ URL: ex. http://127.0.0.1:9091/xmlrpc
USERNAME & PASSWORD: Archiva credentials
-->
<argument>${archiva.url}/xmlrpc</argument>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/pom.xml
index 22391115a..62d2859a0 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-security/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-xmlrpc</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-xmlrpc-security</artifactId>
<name>Archiva Web :: XML-RPC Security</name>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
index 5a545c48c..71f5e2638 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-xmlrpc</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-xmlrpc-services</artifactId>
<name>Archiva Web :: XML-RPC Services</name>
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java
index 385db320a..8493e309a 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.archiva.web.xmlrpc.api.AdministrationService;
import org.apache.archiva.web.xmlrpc.api.beans.ManagedRepository;
import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository;
@@ -38,7 +39,6 @@ import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.maven.archiva.database.ArchivaDatabaseException;
import org.apache.maven.archiva.database.ArtifactDAO;
import org.apache.maven.archiva.database.constraints.ArtifactVersionsConstraint;
-import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
import org.apache.maven.archiva.database.updater.DatabaseConsumers;
import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
import org.apache.maven.archiva.model.ArchivaArtifact;
@@ -49,7 +49,6 @@ import org.apache.maven.archiva.repository.RepositoryContentFactory;
import org.apache.maven.archiva.repository.RepositoryException;
import org.apache.maven.archiva.repository.RepositoryNotFoundException;
import org.apache.maven.archiva.repository.events.RepositoryListener;
-import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler;
import org.apache.maven.archiva.scheduled.tasks.DatabaseTask;
import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
@@ -101,50 +100,29 @@ public class AdministrationServiceImpl
*/
public Boolean configureDatabaseConsumer( String consumerId, boolean enable ) throws Exception
{
- List<DatabaseCleanupConsumer> cleanupConsumers = dbConsumersUtil.getAvailableCleanupConsumers();
List<DatabaseUnprocessedArtifactConsumer> unprocessedConsumers =
dbConsumersUtil.getAvailableUnprocessedConsumers();
boolean found = false;
- boolean isCleanupConsumer = false;
- for( DatabaseCleanupConsumer consumer : cleanupConsumers )
+
+ for( DatabaseUnprocessedArtifactConsumer consumer : unprocessedConsumers )
{
if( consumer.getId().equals( consumerId ) )
{
found = true;
- isCleanupConsumer = true;
break;
}
}
if( !found )
{
- for( DatabaseUnprocessedArtifactConsumer consumer : unprocessedConsumers )
- {
- if( consumer.getId().equals( consumerId ) )
- {
- found = true;
- break;
- }
- }
- }
-
- if( !found )
- {
throw new Exception( "Invalid database consumer." );
}
Configuration config = archivaConfiguration.getConfiguration();
DatabaseScanningConfiguration dbScanningConfig = config.getDatabaseScanning();
- if( isCleanupConsumer )
- {
- dbScanningConfig.addCleanupConsumer( consumerId );
- }
- else
- {
- dbScanningConfig.addUnprocessedConsumer( consumerId );
- }
+ dbScanningConfig.addUnprocessedConsumer( consumerId );
config.setDatabaseScanning( dbScanningConfig );
saveConfiguration( config );
@@ -325,14 +303,8 @@ public class AdministrationServiceImpl
{
List<String> consumers = new ArrayList<String>();
- List<DatabaseCleanupConsumer> cleanupConsumers = dbConsumersUtil.getAvailableCleanupConsumers();
List<DatabaseUnprocessedArtifactConsumer> unprocessedConsumers = dbConsumersUtil.getAvailableUnprocessedConsumers();
- for( DatabaseCleanupConsumer consumer : cleanupConsumers )
- {
- consumers.add( consumer.getId() );
- }
-
for( DatabaseUnprocessedArtifactConsumer consumer : unprocessedConsumers )
{
consumers.add( consumer.getId() );
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
index 5089b289b..04946b4ec 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/test/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImplTest.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.apache.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.archiva.web.xmlrpc.api.beans.ManagedRepository;
import org.apache.archiva.web.xmlrpc.api.beans.RemoteRepository;
import org.apache.commons.io.FileUtils;
@@ -39,7 +40,6 @@ import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration;
import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
import org.apache.maven.archiva.database.updater.DatabaseConsumers;
import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
import org.apache.maven.archiva.model.ArchivaArtifact;
@@ -51,7 +51,6 @@ import org.apache.maven.archiva.repository.content.ManagedLegacyRepositoryConten
import org.apache.maven.archiva.repository.content.PathParser;
import org.apache.maven.archiva.repository.events.RepositoryListener;
import org.apache.maven.archiva.repository.layout.LayoutException;
-import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler;
import org.apache.maven.archiva.scheduled.tasks.DatabaseTask;
import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
@@ -122,10 +121,6 @@ public class AdministrationServiceImplTest
private RepositoryListener listener;
- private DatabaseCleanupConsumer cleanupIndexConsumer;
-
- private DatabaseCleanupConsumer cleanupDbConsumer;
-
private MockControl cleanupConsumersControl;
protected void setUp()
@@ -158,10 +153,6 @@ public class AdministrationServiceImplTest
dbConsumersUtilControl = MockClassControl.createControl( DatabaseConsumers.class );
dbConsumersUtil = ( DatabaseConsumers ) dbConsumersUtilControl.getMock();
- cleanupConsumersControl = MockControl.createControl( DatabaseCleanupConsumer.class );
- cleanupIndexConsumer = (DatabaseCleanupConsumer) cleanupConsumersControl.getMock();
- cleanupDbConsumer = (DatabaseCleanupConsumer) cleanupConsumersControl.getMock();
-
unprocessedConsumersControl = MockControl.createControl( DatabaseUnprocessedArtifactConsumer.class );
processArtifactConsumer = ( DatabaseUnprocessedArtifactConsumer ) unprocessedConsumersControl.getMock();
processPomConsumer = ( DatabaseUnprocessedArtifactConsumer ) unprocessedConsumersControl.getMock();
@@ -189,19 +180,15 @@ public class AdministrationServiceImplTest
recordDbConsumers();
dbConsumersUtilControl.replay();
- cleanupConsumersControl.replay();
unprocessedConsumersControl.replay();
List<String> dbConsumers = service.getAllDatabaseConsumers();
dbConsumersUtilControl.verify();
- cleanupConsumersControl.verify();
unprocessedConsumersControl.verify();
assertNotNull( dbConsumers );
- assertEquals( 4, dbConsumers.size() );
- assertTrue( dbConsumers.contains( "cleanup-index" ) );
- assertTrue( dbConsumers.contains( "cleanup-database" ) );
+ assertEquals( 2, dbConsumers.size() );
assertTrue( dbConsumers.contains( "process-artifact" ) );
assertTrue( dbConsumers.contains( "process-pom" ) );
}
@@ -228,7 +215,6 @@ public class AdministrationServiceImplTest
archivaConfigControl.setVoidCallable();
dbConsumersUtilControl.replay();
- cleanupConsumersControl.replay();
unprocessedConsumersControl.replay();
archivaConfigControl.replay();
configControl.replay();
@@ -244,14 +230,12 @@ public class AdministrationServiceImplTest
}
dbConsumersUtilControl.verify();
- cleanupConsumersControl.verify();
unprocessedConsumersControl.verify();
archivaConfigControl.verify();
configControl.verify();
// test disable "process-pom" db consumer
dbConsumersUtilControl.reset();
- cleanupConsumersControl.reset();
unprocessedConsumersControl.reset();
archivaConfigControl.reset();
configControl.reset();
@@ -271,7 +255,6 @@ public class AdministrationServiceImplTest
archivaConfigControl.setVoidCallable();
dbConsumersUtilControl.replay();
- cleanupConsumersControl.replay();
unprocessedConsumersControl.replay();
archivaConfigControl.replay();
configControl.replay();
@@ -287,7 +270,6 @@ public class AdministrationServiceImplTest
}
dbConsumersUtilControl.verify();
- cleanupConsumersControl.verify();
unprocessedConsumersControl.verify();
archivaConfigControl.verify();
configControl.verify();
@@ -299,7 +281,6 @@ public class AdministrationServiceImplTest
recordDbConsumers();
dbConsumersUtilControl.replay();
- cleanupConsumersControl.replay();
unprocessedConsumersControl.replay();
try
@@ -313,7 +294,6 @@ public class AdministrationServiceImplTest
}
dbConsumersUtilControl.verify();
- cleanupConsumersControl.verify();
unprocessedConsumersControl.verify();
}
@@ -873,19 +853,11 @@ public class AdministrationServiceImplTest
private void recordDbConsumers()
{
- List<DatabaseCleanupConsumer> cleanupConsumers = new ArrayList<DatabaseCleanupConsumer>();
- cleanupConsumers.add( cleanupIndexConsumer );
- cleanupConsumers.add( cleanupDbConsumer );
-
List<DatabaseUnprocessedArtifactConsumer> unprocessedConsumers =
new ArrayList<DatabaseUnprocessedArtifactConsumer>();
unprocessedConsumers.add( processArtifactConsumer );
unprocessedConsumers.add( processPomConsumer );
- dbConsumersUtilControl.expectAndReturn( dbConsumersUtil.getAvailableCleanupConsumers(), cleanupConsumers );
- cleanupConsumersControl.expectAndReturn( cleanupIndexConsumer.getId(), "cleanup-index" );
- cleanupConsumersControl.expectAndReturn( cleanupDbConsumer.getId(), "cleanup-database" );
-
dbConsumersUtilControl.expectAndReturn( dbConsumersUtil.getAvailableUnprocessedConsumers(), unprocessedConsumers );
unprocessedConsumersControl.expectAndReturn( processArtifactConsumer.getId(), "process-artifact" );
unprocessedConsumersControl.expectAndReturn( processPomConsumer.getId(), "process-pom" );
diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/pom.xml b/archiva-modules/archiva-web/archiva-xmlrpc/pom.xml
index 6ada36255..923bd525c 100644
--- a/archiva-modules/archiva-web/archiva-xmlrpc/pom.xml
+++ b/archiva-modules/archiva-web/archiva-xmlrpc/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-web</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-xmlrpc</artifactId>
<name>Archiva Web :: XML-RPC</name>
diff --git a/archiva-modules/archiva-web/pom.xml b/archiva-modules/archiva-web/pom.xml
index ef7076a30..c65901d1a 100644
--- a/archiva-modules/archiva-web/pom.xml
+++ b/archiva-modules/archiva-web/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-modules</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.3-SNAPSHOT</version>
</parent>
<artifactId>archiva-web</artifactId>