For a sample custom consumer, you can checkout the archiva-consumer-plugin at the archiva sandbox in the SVN repository: Prior to release 1.4, plexus components are not anymore supported, you must use Spring components.
Below are the steps on how to create a custom repository consumer and plug it in Archiva:
Ex. @Service("knownRepositoryContentConsumer#discover-new-artifact") @Scope("prototype") where, Service: unique id for your consumer. Scope: the creation strategy prototype or singleton.
Prior to version 1.4-M2, you can use an archetype.
mvn archetype:generate \ -DarchetypeRepository=repo1.maven.org \ -DarchetypeGroupId=org.apache.archiva \ -DarchetypeArtifactId=archiva-consumer-archetype \ -DarchetypeVersion=2.2.0
Note: if you want to use a SNAPSHOT version, replace with the following parameter: -DarchetypeRepository=https://archiva-repository.apache.org/archiva/repository/snapshots/ \