Package setting to prevent Maven duplicates based on version

Problem

The new package setting to allow/disallow duplicate packages uses the package name in the exception regex to determine if duplicates are allowed.

This does not account for package versions. It is common in Maven workflow to not allow duplicates, but allow duplicates for packages that are using SNAPSHOT versions. As pointed out in this comment this new setting does not then allow for users to use a regex like "SNAPSHOT" to disallow duplicates but allow SNAPSHOT duplicates for all versions.

This also does not align with the copy below the regex text field.

Solution

We could simply update the setting logic to also check against the version. There may be some additional updates (or at least tests) that will be needed for the Maven-specific code.

Possible concerns

  • What if a user names a package using the word "snapshot"? This could just be something we make clear in the docs and leave to the user to be responsible for keeping track of.
  • This logic is generalized and although we only have the setting for Maven right now, this will eventually be the logic for all package types. Do we want to have the name/version combination used for all package types?
Edited by Steve Abrams