You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@archiva.apache.org by "Marc Lustig (JIRA)" <ji...@codehaus.org> on 2009/10/08 15:59:54 UTC

[jira] Commented: (MRM-747) Archiva should prevent re-deployment of released or non-snapshot versioned artifacts

    [ http://jira.codehaus.org/browse/MRM-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=194030#action_194030 ] 

Marc Lustig commented on MRM-747:
---------------------------------

This is my patch that prevents deploying release-artifacts which already exist in the release-repository.
Thanks to Deng for pointing me in the right direction.

The following files have been changed:
- class class org.apache.maven.archiva.webdav.ArchivaDavResourceFactory in archiva-modules/archiva-web/archiva-webdav/src/main/java

The following files have been added:
- class org.apache.maven.archiva.webdav.ReleaseArtifactAlreadyExistsException in archiva-modules/archiva-web/archiva-webdav/src/main/java

In case
- a jar is deployed
- the artifact-path does not contain the string SNAPSHOT
- the target-repo is enabled for release-artifacts
a check is commenced verifying if that artifact already exists.

In case the artifact already exists, the ReleaseArtifactAlreadyExistsException is thrown to the calling method and converted to DavException with HTTP return-code SC_CONFLICT (HTTP 409).

I have tested that with "real" repos, not with repo-groups. But since repo-groups cannot be written to, I suppose we won't run into issues there.
The unit-tests are running fine.

> Archiva should prevent re-deployment of released or non-snapshot versioned artifacts
> ------------------------------------------------------------------------------------
>
>                 Key: MRM-747
>                 URL: http://jira.codehaus.org/browse/MRM-747
>             Project: Archiva
>          Issue Type: Bug
>          Components: WebDAV interface
>    Affects Versions: 1.0.1
>            Reporter: Alexandre Navarro
>             Fix For: 1.x
>
>
> It is possible de redeploy a versionned jar with webdav eventhough it must be impossible.
> It is possible de redeploy a versionned jar eventhough the file is readonly.
> It is very problematic.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira