archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <>
Subject Re: auto generating an archetype-catalog.xml when navigating to a root/archetype-catalog.xml
Date Fri, 17 Jun 2011 04:19:05 GMT

On 17/06/2011, at 12:03 PM, Jarrod Roberson wrote:

> On Thu, Jun 16, 2011 at 8:41 PM, Brett Porter <> wrote:
>> On 17/06/2011, at 6:13 AM, Jarrod Roberson wrote:
>>> I am trying to add this feature to Archiva, but I can't figure out where
>> to
>>> start?
>>> This is a critical feature I need to add for our environment in order to
>>> enabled my distributed team to create projects from a standard set of
>>> company archetypes?
>>> What I need to know is:
>>> 1. How to search all the repositories for artifacts of packaging type
>>> "maven-archetype"?
>> Are you working against trunk (unreleased, and significant changes to the
>> repository APIs), or trying to patch Archiva 1.3.x?
> I want to patch up 1.3.x where X is the latest.

Ok. In that case, I recommend writing a consumer that will hook into the arrival / departure
of artifacts and updates the archetype-catalog at the time. That will work across both versions,
and makes the request for the catalog fast.

An example of handling an added artifact:

An example of handling a removed artifact: DatabaseCleanupRemoveArtifactConsumer

Note that you'll need to make sure you are working from the right codebase - I'm not sure
if the github mirrors retain the tags & branches from svn.

>> This should just appear as the normal catalog at the root of a repository
>> group, right?
> I am just dumping it at the root of the application in my case
> /opt/archiva/apps/archiva/archetype-catalog.xml
> There is a <repository/> element in each entry that points back to which
> repository the archetype lives in.

But that won't take into account, for example, security - if the requester can only see a
subset of the repositories.

> Thanks for the help, I will report back what I get done. There is a bug open
> for this 1284, maybe I can get that closed.


> PS: I decided I might could do this with mvn archetype:crawl and a cron job,
> but I can't get mvn archetype:crawl to generate a file, it walks the
> internal and snapshots directory structures and spews out all the artifacts,
> but never generates a file. I am using Maven 3.0.3 by the way.

I'm not familiar with it...

- Brett

Brett Porter

View raw message