Archiva keeps showing deleted SNAPSHOT version artifacts in Browse - maven

Our Archiva Repository (version 2.2.1) is configured with both a snapshot and a release repositories.
Snapshot repository is configured with 1 retention count, 1 day old, and to delete released snapshots.
And also, the repository-purge consumer is enabled.
The thing is I can see (in the server, in the snapshot repository folder) that the snapshot artifact files are being removed, but when i BROWSE the Archiva, it is still showing that snapshots, and the artifact (although with 0b size)
Versions of the artifact, all repositories
Artifacts for 0.0.1-SNAPSHOT
Is this behavior intended, or something in the purge process is failing and not removing this references?
Is it possible to adjust Archiva to delete this references (apart from manually delete the snapshot versions)?

This is a known issue that has been resolved in the unreleased version of 2.2.4 of Archiva. They will not release a 2.2.4 version, but are working on a 3.0.0 version that contains the fix for the bug. The date for the release has not been confirmed yet, but the fix is available : https://issues.apache.org/jira/browse/MRM-1958

Related

Apache Maven - Downgrading to previous snapshot dependency version is not working

I have a maven project which is injected with a SNAPSHOT dependency 2.0.0-SNAPSHOT which is there in artifactory. Now dependency project's pom version is updated to 2.0.1-SNAPSHOT and it was built (from a jenkins job) and this snapshot is also there in artifactory. So now artifactory has both the versions 2.0.0-SNAPSHOT and 2.0.1-SNAPSHOT and on local m2 repository also both versions are there.
Main project updated the SNAPSHOT dependency to 2.0.1-SNAPSHOT and it is able to see the new changes in 2.0.1-SNAPSHOT.
Now code changes are made in 2.0.0-SNAPSHOT and it was build and updated in artifactory but now when main project reverted back to 2.0.0-SNAPSHOT and built with -U (force update snapshots), it is not able to see new change done in 2.0.0-SNAPSHOT.
Can anyone suggest what could be wrong here ?

why does maven check for updates when I have specified a version?

I have trouble understanding, why maven has to check for updates each time we build a project.
The pom has specific version mentioned for each dependency. Once those versions are downloaded to the local repo, then maven can use that local copy to build the project. So why does maven have to check for updates when we build the project each time other than just using the local copy?
a side question.
can a maven artifact be changed after releasing it to a repo under a specific version?
As per Maven, an artifact mainly can be of two types - a RELEASE one and a SNAPSHOT one. RELEASE dependency(eg: 1.0.1, 2.3.0 etc) of an artifact is a source of truth. Means 1.0.1 version of a jar (say test.jar) will always be the same always. We will release artifacts to remote repository, whenever the product matures or after a sequence of bug fixes.
On the other hand, a development is on going in a project, then specified its version number as SNAPSHOT(eg: 2.0-SNAPSHOT, 1.1-SNAPSHOT etc).
Say if we specified test-2.0-SNAPSHOT.jar as dependency in our project pom. If we look at the remote repository (Nexus, archiva etc), we can see that it is not saved as version 2.0-SNAPSHOT rather it will be saved artifact version as date-timestamp-buildnumber format, the date-timestamp at which the artifact was built and uploaded to remote repo. (eg: test-2.0-20150105082634.jar)
So when ever the development team does the fix for an issue on a daily basis the updated jar with date timestamp will be in uploaded to the remote repo. So it is necessary for maven to do look up for the latest date timestamp of SNAPSHOT artifacts. Maven does this by maven-metadata.xml file in the artifact directory in the repo.
Hope this clarifies your query. Let me know, if you need any clarifications

Importing a snapshot version of a dependency into Maven repository

I am having trouble importing dependencies for my Grails project into the company Nexus repository. The Grails plugin I would like to use is events-push (https://github.com/smaldini/grails-events-push). The latest released version of the plugin is 1.0.M7. It uses a very old version of Atmosphere library. The GutHub repository contains a more up-to-date version of events-push plugin, 1.0.0.BUILD-SNAPSHOT. I built the Grails plugin from the local clone of the repository and got it to work in my dev environment.
To deploy it on the intranet (in the production environment) I need to import all the plugin dependencies into the company Nexus repository. This is where I run into trouble. The project depends on a SNAPSHOT version of events-push plugin, which in turn depends on SNAPSHOT version of other Grails plugins and Java libraries (according to dependency report).
Nexus supports two types of repositories, Release and Snapshot. I can add artifacts to a Release repository (through the browser UI or in a batch mode using curl), but the artifact must not be a snapshot. I can change the repository to be a Snapshot repository, but then I lose the ability to add artifact to it through the browser or curl command.
How do I make these SNAPSHOT artifacts available to the Grails project through Maven?
Change them to a release version and deploy them to the release repository.

Gradle Dependency Management: latest.integration vs. latest.release

I just came across a small question concerning Gradle's dependency management.
I know that I can declare dependencies using latest.integration to reference snapshots or use latest.release to reference artifacts from release builds.
My question is:
Does latest.integration exclusively and only refer the latest SNAPSHOT artifacts or will latest.integration resolve using a release artifact, if the latest release artefact has a higher version than the latest from integration?
Example:
latest snapshot artifact: 2.1
latest release artifact: 2.2
If using latest.integration, which one will be used to resolve the dependency?
If its the case that latest.integration also integrates release artifacts, by which rule can I explicitly refer to snapshot artifacts?
latest.integration resolves to latest snapshot or release, whichever is newer. There is no symbolic version for latest snapshot only (use 1.2.3-SNAPSHOT).

How maven decides to reference the latest artifact information

We use mvn deploy:deploy to deploy an artifact to repository manager and a developer could have done just mvn install for the same artifact, so the artifact is present under M2_HOME\.m2\repository
Will the maven runtime retrieve the artifact from the repository manager if it was updated recently than the local repository copy?
Note: We use a maven repository manager based on Apache Archiva.
The answer depends on whether you're talking about a snapshot or a release build.
Release builds have a version that doesn't end with "-SNAPSHOT", and they're final and immutable. Once installed to any repository, Maven will never update them. To your question, that means that if a dev installs a release build locally, it will never be updated from any remote repository.
Snapshot builds are always eligible to be updated from any repository. By default, Maven checks once per day for new snapshot versions, so if someone installs a snapshot locally, that snapshot will exist until Maven does its next check for snapshot updates. Then, if a newer version is in any remote repository it checks, the local one will be overwritten. You can force maven to update snapshot artifacts with the -U command line option.

Resources