archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maria Odea Ching <och...@exist.com>
Subject Re: Help on how Archiva consumers work
Date Wed, 12 Dec 2007 08:13:02 GMT
Hi Dario,

I think the solution you've proposed would work.. to implement it, these 
are probably what you need to change in Archiva:

1. update the UnprocessedArtifactPredicate
    - add the constraint to get the SNAPSHOT artifacts as you've 
mentioned (there is a 'snapshot' field in the ArchivaArtifactModel which 
flags whether the artifact is a snapshot or not, though using this would 
return all snapshots -- unique & non-unique)

2. update UnprocessedArtifactPredicate
    - add check if artifact isProcessed() OR isSnapshot() for the 
condition the artifact needs to satisfy

3. update ProjectModelToDatabaseConsumer
    - in the statement if( hasProjectModelInDatabase(...) ) is 
satisfied, the project model/pom file should be verified against the 
existing project model (in the db) if there were updates or changes made 
to it (maybe via the lastModified date or via its checksum). If there 
are changes, then the existing project model must be removed from the db 
and the new project model shall be added.


I've also thought of another way to tackle this issue..

You could just update the DatabaseCleanupRemoveProjectModelConsumer to 
add checking for changes in the project models/pom files of those 
artifacts that have already been processed. If the project model has 
been changed, just remove the project model from the db and update the 
ArchivaArtifactModel's "whenProcessed" field to NULL so that it would 
qualify in the UnProcessedArtifactPredicate(false) constraint. The other 
thing that needs to be done is to update the JdoDatabaseUpdater's 
update() method -- just switch the lines updateAllUnprocessed() and 
updateAllProcessed() inside it. updateAllProcessed() should be executed 
first  before updateAllUnprocessed() in order to capture the updates 
performed in DatabaseCleanupRemoveProjectModelConsumer.

More thoughts/suggestions anyone? :-)

  
Thanks,
Deng


Dário Oliveros wrote:
> Hi all,
>
> I would like to understand why a processed artifact does not have
> update-db-project consumer in case of a non-unique SNAPSHOT project (please
> refer to http://jira.codehaus.org/browse/MRM-622 for more information).
>
> The reason for bringing this up is that the database is not being updated
> accordingly when a non-unique SNAPSHOT project with dependency version
> changes is deployed once again to Archiva repository. Even though it
> contains differences compared to the previous one, it's considered processed
> already and therefore not updated. It looks like a bug in my opinion and I
> would like to contribute for this fix.
>
> Should I change the query constraint for unprocessed artifacts
> (ArtifactsProcessedConstraint(false)) so it also retrieves the non-unique
> SNAPSHOT projects or add a new consumer to processed artifacts for database
> update ?
>
> Any tips or pointers would be appreciated.
>
> Thanks,
> Dário
>
>
>
>
>   


Mime
View raw message