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 Thu, 18 Nov 2010 02:57:02 GMT
On Wed, Nov 17, 2010 at 9:56 PM, Jim Sellers <jim.sellers@gmail.com> wrote:
> 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.

You're welcome :)

>
> 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.

It shouldn't be necessary to use archiva-consumers as parent, but
there's no problem in using it too.

As an additional note, if you will be using Plexus to wire the
components in your consumer instead of Spring, you'd need to have this
configuration in your POM:

     <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <version>1.0-beta-3.0.5</version>
        <executions>
          <execution>
            <id>generate</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

We've replaced the plexus-maven-plugin with the above. This is already
configured in archiva-consumers POM 1.3.1, so if you're using that as
your parent already, you don't need to configure the above plugin in
your consumer's POM.

>
> Do you think that I should open a jira ticket for the consumer doc being out
> of date ?

Yes, that would be great :) Thanks!

-Deng

>
> Thanks for your help,
> Jim
>
>
> On Wed, Nov 17, 2010 at 3:55 AM, Deng Ching <odeaching@gmail.com> 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 <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