archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deng Ching <odeach...@gmail.com>
Subject Re: consumer documentation out of date?
Date Wed, 17 Nov 2010 08:55:49 GMT
Hi Jim,

AFAICT, you can pattern it like one of the consumers here:

https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers

You can probably take a look at ArtifactMissingChecksumsConsumer in
this module as an example. Since Archiva is now using Spring as the
container, you can configure your consumer as a Spring bean (see
src/main/resources/META-INF/spring-context.xml in the same module).
We're using the plexus-spring adapter which already does the
conversion of Plexus components to Spring beans.

To plugin Plexus components to your consumer, just use the Plexus
component "role-hint" as the bean id when referencing the component in
spring. If no "role-hint" is specified, the default is the class' name
specified in the "role" attribute in camel case. For example in the
ArtifactMissingChecksumsConsumer bean config in the spring-context.xml
file I mentioned above, it references the bean "archivaConfiguration".
The implementation being referenced for that is
DefaultArchivaConfiguration. If you look at that class'
@plexus.component annotation, the "role" is
"org.apache.maven.archiva.configuration.ArchivaConfiguration" and
since no "role-hint" is specified, the role-hint/bean ID then is
"archivaConfiguration".

I hope this answers questions #2 and #3. I'm not sure what you meant
by question #1.. can you please clarify? :)

Thanks,
Deng

On Wed, Nov 17, 2010 at 6:19 AM, Jim Sellers <jim.sellers@gmail.com> wrote:
> Hi all.
>
> I'm trying to write a consumer that deletes released artifacts by groupId
> and date (loaded from a properties file in the conf directory).  We're doing
> this because we don't need to keep all released binaries ever built and to
> address disk issues.  I'm basing my impl on RepositoryPurgeConsumer.
>
> However I'm having some trouble when trying to follow the docs.  Even
> looking looking at the latest snapshot version [1] or the sample plugin
> [2].  From MRM-1015 [3] I would guess that some spring config is now
> needed.  If I unpack archiva-core-consumers-1.3.1.jar I find both plexus
> config and spring config.
>
> My questions come down to:
> 1) What config do I need in my pom to generate the correct files?
> 2) What spring config do I need to have?
> 3) What plexus comments do I need (if any) to add to my code?
>
> Thanks in advance for any help.
> Jim
>
>
> [1]
> http://archiva.apache.org/docs/1.4-SNAPSHOT/customising/writing-consumer.html
> [2] http://svn.apache.org/repos/asf/archiva/sandbox/archiva-consumer-plugin/
> [3] http://jira.codehaus.org/browse/MRM-1015
>

Mime
View raw message