Below is a modded version of the quick and dirty 'mvn-clear-snapshots'
script I have for clearing out SNAPSHOT artifacts for the project I'm
currently working on. I typically run it prior to performing my first
build of the day (the version I actually use decends only into the
directory structure for the project I'm working on).

This isn't as smart as the hypothetical one that Wayne suggests (mine
doesn't keep the latest version around). But if you know that someone (or
something) can be counted on to deploy a snapshot build before too long,
anyway, maybe it will work "good enough" for you.

-Al

----------------------------------8<-----------------------------------
#!/bin/sh

set -x

M2_REPO_PATH="${HOME}/.m2/repository"
if ( find "${M2_REPO_PATH}" -type d -name '*SNAPSHOT*' > /dev/null 2>&1 ); then
    find "${M2_REPO_PATH}" -type d -name '*SNAPSHOT*' -print0 | \
      xargs --null -I '{}' rm -vfr {}
fi
----------------------------------8<-----------------------------------


On Thu, Oct 18, 2007 at 12:48:47PM -0500, Wayne Fay spake thus:
> Not that I've seen, but when you write it later today, maybe you won't
> mind contributing it back via this list and/or the Wiki for the
> benefit of future users? ;-)
> 
> It should be a simple script -- for all directories, if this is a
> snapshot version, find latest and delete (or move) the rest. Then run
> it via cron.
> 
> Wayne
> 
> On 10/18/07, Thomas Jackson <[EMAIL PROTECTED]> wrote:
> > We have an internal repository and are constantly deploying snapshots
> > throughout the day.  We want to clean these nightly(to preserve space)
> > and I was wondering if anyone had a shell script already written that
> > will cleanup snapshots nightly?
> >
> > Thanks
> > Thomas Jackson
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to