What is the best strategy for retiring an artifact out of a maven repository? You can base it off of time; you only keep 2 years of milestones and latest snapshots. You can check based on how long since the last time an artifact has been accessed. It is probably a good idea to keep every artifact around that is currently in production, just in case you need to fix something. You also have to figure out how many versions of a snapshot to keep.
I would like to see garbage collection as a method for artifact retirement. Let's start by defining the roots as everything that is currently used by production, qa and development. We can also add implicit roots for every artifact that is younger than a set period of time.
From there, we can you a standard mark-and-sweep algorithm that starts from the roots and goes through all of there dependencies. Anything that isn't marked gets deleted. If you use the symbolic link concept for milestones then this answers the question of how many versions of a snapshot to keep. Garbage collection will take care of removing all the snapshots that are too old but not in use. Garbage collection has an added benefit of indexing the reverse dependencies. The collector can save the path to the root when it marks an artifact. This helps you answer the question "who is using this artifact?"
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.