Return-Path: Delivered-To: apmail-maven-archiva-dev-archive@locus.apache.org Received: (qmail 83604 invoked from network); 12 Dec 2007 11:35:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2007 11:35:37 -0000 Received: (qmail 1206 invoked by uid 500); 12 Dec 2007 11:35:26 -0000 Delivered-To: apmail-maven-archiva-dev-archive@maven.apache.org Received: (qmail 1165 invoked by uid 500); 12 Dec 2007 11:35:26 -0000 Mailing-List: contact archiva-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: archiva-dev@maven.apache.org Delivered-To: mailing list archiva-dev@maven.apache.org Received: (qmail 1156 invoked by uid 99); 12 Dec 2007 11:35:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 03:35:26 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2007 11:35:03 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1J2Prm-00045l-2h for archiva-dev@maven.apache.org; Wed, 12 Dec 2007 03:35:06 -0800 Message-ID: <14293357.post@talk.nabble.com> Date: Wed, 12 Dec 2007 03:35:06 -0800 (PST) From: =?UTF-8?Q?D=C3=A1rio_Oliveros?= To: archiva-dev@maven.apache.org Subject: Re: Help on how Archiva consumers work In-Reply-To: <475FB8E5.9020205@exist.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: oliveros@cpqd.com.br References: <14272457.post@talk.nabble.com> <475F980E.3080607@exist.com> <14292430.post@talk.nabble.com> <475FB8E5.9020205@exist.com> X-Virus-Checked: Checked by ClamAV on apache.org Thank you for letting me contribute with such a nice project. I appreciate it. BTW do you happen to have any code style formatter profile for Eclipse Europa ? I noticed Archiva's is a little bit different from Java Convention profile and I could not find it anywhere. Thanks. Maria Odea Ching-2 wrote: >=20 > Okey dokey, thanks a lot Dario! :-) >=20 > -Deng >=20 > D=C3=A1rio Oliveros wrote: >> Good to hear from you. >> >> I had made some code changes before getting your response back and >> surprisingly I was on the right track by working on pretty much the same >> steps as you've suggested in the first place. The only difference was >> regarding the UnprocessedArtifactPredicate to where I added a new >> condition >> for checking whether whenProcessed date is before lastModified instead o= f >> using snapshot verification. Besides I changed the else statement of >> ArtifactsProcessedConstraint by adding the same verification as shown >> previously: >> whereClause =3D "whenProcessed =3D=3D null || (whenProcessed !=3D null &= & >> whenProcessed < lastModified)"; >> In your third step, I went for the date checking instead of checksum. >> >> Anyway it looks like your second solution is better since it tends to be >> cleaner than the first one. >> I will take a look and let you know as soon as I can. Once I fix the >> issue, >> I will post the patch for your analysis. >> >> Thank you so much for your support. >> >> >> >> Maria Odea Ching-2 wrote: >> =20 >>> Hi Dario, >>> >>> I think the solution you've proposed would work.. to implement it, thes= e=20 >>> are probably what you need to change in Archiva: >>> >>> 1. update the UnprocessedArtifactPredicate >>> - add the constraint to get the SNAPSHOT artifacts as you've=20 >>> mentioned (there is a 'snapshot' field in the ArchivaArtifactModel whic= h=20 >>> flags whether the artifact is a snapshot or not, though using this woul= d=20 >>> return all snapshots -- unique & non-unique) >>> >>> 2. update UnprocessedArtifactPredicate >>> - add check if artifact isProcessed() OR isSnapshot() for the=20 >>> condition the artifact needs to satisfy >>> >>> 3. update ProjectModelToDatabaseConsumer >>> - in the statement if( hasProjectModelInDatabase(...) ) is=20 >>> satisfied, the project model/pom file should be verified against the=20 >>> existing project model (in the db) if there were updates or changes mad= e=20 >>> to it (maybe via the lastModified date or via its checksum). If there= =20 >>> are changes, then the existing project model must be removed from the d= b=20 >>> 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= =20 >>> add checking for changes in the project models/pom files of those=20 >>> artifacts that have already been processed. If the project model has=20 >>> been changed, just remove the project model from the db and update the= =20 >>> ArchivaArtifactModel's "whenProcessed" field to NULL so that it would= =20 >>> qualify in the UnProcessedArtifactPredicate(false) constraint. The othe= r=20 >>> thing that needs to be done is to update the JdoDatabaseUpdater's=20 >>> update() method -- just switch the lines updateAllUnprocessed() and=20 >>> updateAllProcessed() inside it. updateAllProcessed() should be executed= =20 >>> first before updateAllUnprocessed() in order to capture the updates=20 >>> performed in DatabaseCleanupRemoveProjectModelConsumer. >>> >>> More thoughts/suggestions anyone? :-) >>> >>> =20 >>> Thanks, >>> Deng >>> >>> >>> D=C3=A1rio Oliveros wrote: >>> =20 >>>> 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=C3=A1rio >>>> >>>> >>>> >>>> >>>> =20 >>>> =20 >>> >>> =20 >> >> =20 >=20 >=20 >=20 --=20 View this message in context: http://www.nabble.com/Help-on-how-Archiva-con= sumers-work-tp14272457p14293357.html Sent from the archiva-dev mailing list archive at Nabble.com.