You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Jarrod Roberson <ja...@vertigrated.com> on 2011/06/20 22:07:16 UTC

Is there a way to automatically delete all the -SNAPSHOT versions when a non-SNAPSHOT version is uploaded?

When I do release:preform to upload my released 1.0 version to Archiva, I
would like to automatically remove all the 1.0-SNAPSHOT versions from the
snapshots repository.
This will force everyone on my team to abandon the SNAPSHOT line and move on
to the correct version.

I would also like to restrict new 1.0-SNAPSHOT versions from being uploaded
after 1.0 is released to keep people from promoting the old and now stable
and released version.

Can Archiva do this out of the box?

If now where do I start looking to add this code? ( 1.3.x release is what I
am using )

-- 
Jarrod Roberson

Re: Is there a way to automatically delete all the -SNAPSHOT versions when a non-SNAPSHOT version is uploaded?

Posted by Brett Porter <br...@apache.org>.
On 21/06/2011, at 6:34 AM, Wendy Smoak wrote:

> On Mon, Jun 20, 2011 at 4:29 PM, Jarrod Roberson <ja...@vertigrated.com> wrote:
> 
>> I have a highly distributed team and not everyone pays attention to their
>> emails as good as they should and don't tend to read wiki pages for
>> comprehension either.
>> thus returning an error that the -SNAPSHOT version you are trying to publish
>> is at a release and no longer allowed to be updated would notify them of
>> their mistake.
> 
> Archiva already responds with a 409 when you try to deploy a release
> that already exists (assuming you've turned on that option) so it
> sounds feasible.  Someone more familiar with the code can give you a
> pointer when they wander by.

You can look in ArchivaDavResourceFactory (under the archiva-webdav module), where SC_CONFLICT appears. Let us know if we can provide any assistance!

Cheers,
Brett

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter





Re: Is there a way to automatically delete all the -SNAPSHOT versions when a non-SNAPSHOT version is uploaded?

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Jun 20, 2011 at 4:29 PM, Jarrod Roberson <ja...@vertigrated.com> wrote:

> I have a highly distributed team and not everyone pays attention to their
> emails as good as they should and don't tend to read wiki pages for
> comprehension either.
> thus returning an error that the -SNAPSHOT version you are trying to publish
> is at a release and no longer allowed to be updated would notify them of
> their mistake.

Archiva already responds with a 409 when you try to deploy a release
that already exists (assuming you've turned on that option) so it
sounds feasible.  Someone more familiar with the code can give you a
pointer when they wander by.

There's also the idea that developers shouldn't be deploying snapshots
at all... only the canonical build environment on the CI server should
be allowed to publish, which would also stop it.

-- 
Wendy

Re: Is there a way to automatically delete all the -SNAPSHOT versions when a non-SNAPSHOT version is uploaded?

Posted by Jarrod Roberson <ja...@vertigrated.com>.
thanks for the reply, personally I want to block uploads of -SNAPSHOT
versions if there is a release version rather than rely on people to move
on.
I have a highly distributed team and not everyone pays attention to their
emails as good as they should and don't tend to read wiki pages for
comprehension either.
thus returning an error that the -SNAPSHOT version you are trying to publish
is at a release and no longer allowed to be updated would notify them of
their mistake.

It isn't a social problem as much as a human nature problem and can be
tacked with a few lines of code more consistently than any other
alternative.

Re: Is there a way to automatically delete all the -SNAPSHOT versions when a non-SNAPSHOT version is uploaded?

Posted by Wendy Smoak <ws...@gmail.com>.
On Mon, Jun 20, 2011 at 4:07 PM, Jarrod Roberson <ja...@vertigrated.com> wrote:

> When I do release:preform to upload my released 1.0 version to Archiva, I
> would like to automatically remove all the 1.0-SNAPSHOT versions from the
> snapshots repository.
> This will force everyone on my team to abandon the SNAPSHOT line and move on
> to the correct version.

Yes, there is a "delete released snapshots" option, see:
http://archiva.apache.org/docs/1.3.5/adminguide/repositories.html .

However it won't _force_ your teammates to move on -- as long as they
have the snapshot in their local repository they can still use it.

> I would also like to restrict new 1.0-SNAPSHOT versions from being uploaded
> after 1.0 is released to keep people from promoting the old and now stable
> and released version.

I don't think there's an option to prevent deployment, but they ought
to keep getting deleted when the repository is scanned and updated.

Feel free to file it as an enhancement request in JIRA, but... it
feels a bit like solving a social problem with technology. ;)  If
you've communicated that there has been a release with this list of
fixes, they should *want* to upgrade to the stable release rather than
staying with the snapshot.

I'd spend some time understanding the underlying problem before
throwing more technology at it.  What's really going on?

(I was about to ask you to post to the user list, but you *did* ask
where the code to modify would be, so... ;) )

-- 
Wendy