Creating a repository where the users can deploy their artifacts and once the testing tasks are completed, a user can deploy the artifact to the common place where we can use those artifacts as dependencies in POM files or remove the artifact from the temporary repository if it fails during the testing phase.
Apache Archiva is a repository management system where we can deploy our artifacts to a common location and later on we can make use of those artifacts (jar files, war files, zip files, ear files, etc.) in our projects by adding the artifacts as dependencies in the POM file. But here there is no separate place to deploy the artifacts which are are not tested yet and also the artifacts of an ongoing project(modules).So we need to deploy them to the common location where the official artifacts are deployed. So there can be some issues due to the use of those artifacts as dependencies in our projects since they are not properly tested.
So here my idea is to create a separate place (repositories) where the registered user can deploy the staging artifacts. Those artifacts are not visible to common users. Once the testing task is completed (ready for public deployment), we can either merge them to the common place where others can make use of those artifacts or remove them from the staging area (if it fails).
First I would like to give a brief introduction about my approach to adding the staging repository feature.
Currently, Archiva has two permanent repositories called internal and the snapshots. Here, my idea is to propose an intermediate staging repository to deploy artifacts which have not been tested yet. It is the Archiva user's task to create this permanent staging repository and attach it for a selected repository. The following example will illustrate that scenario.
Let's say the user has a repository called “data_repo” and he needs to get the support of staging repository. Then he has to create staging repository instance called “data_repo_stage” and he can attach this stage repository to his main repository called “data_repo”. (I hope to offer this function through the web interface). Here, user can add more than one stage repository so that simultaneous releasing function will be supported. Promotion is done through the following path.
data_repo_stage >>> data_repo
I think in the stage repository we should limit the access. Nobody should allow to download the artifacts in the staging repositories other than the developers, QA people, Archiva admin user, and the the guy who have the permission for the promotion. Here, for the QA, promotion and the developers, I am going to use current Archiva roles (Repository Manager and Repository Observer) and assign the permission for them.
I think by default it is the repository manager's task to create the stage repositories and attach it to the main repository that he want to add the staging functionality. But those permissions should be configured to any role according to the requirements.
Here, registered users can read and write artifacts to the repository, where registered users mean developers and the QA people. Here, developers should have both read and write access while the QA guys have only read access. Also QA guys should be able to mark the artifact as success one or a failure one. Then it will be useful for the merging part to take a correct decision.
This is the most important part in this project. Once the testing tasks are done, this role is responsible for merging artifacts from staging repository to the internal repository or the snapshot repository. It depends on the artifact(snapshot or a version). Here I am going to consider the following things regarding the merging the artifacts:
In above, I have mentioned only the success scenario of an artifact. There can be a fail scenario as well. If an artifact is failed then the user should manually delete the artifact