Hi Deng. Thanks a lot, that looks like a great place for me to start. I'll see if I can have more success with this.
What I meant by # 1 was there any specific pom config that I needed to do in order to build a plugin. e.g. in the doc in the website it talks about the plexus-maven-plugin. I'll start with just using the archiva-consumers as my parent. Do you think that I should open a jira ticket for the consumer doc being out of date ? Thanks for your help, Jim On Wed, Nov 17, 2010 at 3:55 AM, Deng Ching <[email protected]> wrote: > 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 <[email protected]> > 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 > > >
